52

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

git clone -o heroku [email protected]: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.

1

9 Answers 9

46

simply run

bundle --full-index

that should do the trick

3
  • 1
    Yup, that's what I was looking for, as well. I had recently published a gem, and was encountering the "not found" error. Thanks!
    – techpeace
    Oct 21, 2016 at 23:27
  • 2
    what does this do? bundle --help does not have an option listed for --full-index
    – johnsimer
    Nov 8, 2018 at 1:38
  • 3
    @johnsimer as bundler.io states the option --full-index uses the modern index instead of the API endpoint. For some reason this is more exhaustive than without that option
    – Jamie-505
    Nov 10, 2018 at 11:43
24

According to rubygems.org, jquery-rails 2.0.0 has been yanked. That explains the error you had with jquery-rails.

Running $ bundle update jquery-rails will rebuild your gem snapshot. That way you don't have to delete Gemfile.lock

3
  • But that will update all of my gems that don't have versions specified right? That's what I'm trying to avoid.
    – ben
    Aug 9, 2012 at 15:16
  • 2
    You can use $ bundle update <gem_name> to only update a specific gem.
    – Hoa
    Aug 9, 2012 at 15:22
  • 12
    This answer should be updated to reflect the fact that running straight bundle update is a bad idea in general. It's essentially the exact same thing as deleting Gemfile.lock. See here: stackoverflow.com/questions/11876788/…
    – pwightman
    Nov 19, 2012 at 18:46
8

An old version of bundler was giving me this same issue. After a bunch of puzzling, I realized that this was the issue.

Running gem install bundler fixed it completely.

4

I've found it safest ALWAYS to specify gem versions, and only change them when necessary. Saved me a LOT of trouble.

4

bundle update jquery-rails will update just the jquery-rails gem, which is likely what you're looking for. Running bundle update is the equivalent of deleting Gemfile.lock and is not recommended in most cases. See here: Heroku push rejected: can't find jquery-rails-2.0.0 in sources

3

In my case, the only thing that helped was a

bundle install --force

Looked like bundler thought the dependencies have been installed. But turns out it wasn't correctly.

1
  • 1
    Update: The --force option was renamed to --redownload
    – CAVP33
    Mar 17, 2023 at 6:42
1

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...

1

For me bundle update followed by gem pristine racc worked. It was something related to native repository.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.