Is there a fix for the "Could not find *gem* in any of the sources" error that doesn't involve deleting Gemfile.lock?

Viewed 43822

I am trying to get my development environment setup on a new computer.

git clone -o heroku git@heroku.com:theirapp.git
cd theirapp
bundle
Fetching gem metadata from https://rubygems.org/......
Fetching gem metadata from https://rubygems.org/..
Could not find jquery-rails-2.0.0 in any of the sources

After googling this error, the response seems to be to delete Gemfile.lock, then running bundle again. This works, but then I have different versions of gems where I haven't specified a version in Gemfile. Is there a way to fix this error without deleting Gemfile.lock? I'm using Rails 3.2 and Ruby 1.9.3.

7 Answers

I had the same issue but with a different gem. Running gem install yourgem -v 1.x.x solved my problem.

In my case, this error was caused by a frozen lockfile. Editing my-repository-root/.bundle/config to set BUNDLE_FROZEN: "false" fixed the problem.

bundle install did not change the lockfile afterwards, so I don't understand why BUNDLE_FROZEN broke anything to begin with...

Related