51

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.

ben
  • 29,229
  • 42
  • 124
  • 179
  • See http://stackoverflow.com/questions/11876788/heroku-push-rejected-cant-find-jquery-rails-2-0-0-in-sources. The accepted answer is similar to this one and also dangerous so check the other answers. – Brian Deterling Nov 14 '12 at 05:23

9 Answers9

43

simply run

bundle --full-index

that should do the trick

Jamie-505
  • 1,170
  • 1
  • 12
  • 16
  • 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 '16 at 23:27
  • 2
    what does this do? `bundle --help` does not have an option listed for `--full-index` – johnsimer Nov 08 '18 at 01:38
  • 3
    @johnsimer as [bundler.io](https://bundler.io/v1.2/bundle_install.html) 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 '18 at 11:43
23

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

Jason Noble
  • 3,756
  • 19
  • 21
Hoa
  • 3,179
  • 1
  • 25
  • 33
  • 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 09 '12 at 15:16
  • 2
    You can use $ bundle update to only update a specific gem. – Hoa Aug 09 '12 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: http://stackoverflow.com/questions/11876788/heroku-push-rejected-cant-find-jquery-rails-2-0-0-in-sources/12048770#12048770 – pwightman Nov 19 '12 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.

Harlan T Wood
  • 2,064
  • 21
  • 19
4

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

pixelearth
  • 13,674
  • 10
  • 62
  • 110
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

Community
  • 1
  • 1
pwightman
  • 784
  • 1
  • 4
  • 9
2

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.

Dirk
  • 1,064
  • 1
  • 11
  • 13
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...

BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283
0

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

0

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