17

I'm trying to push an Enki gem blog to Heroku and I'm getting an error

Could not find jquery-rails-2.0.0 in any of the sources

However, in the Gemfile I had

`gem 'jquery-rails'`

and I've never had a problem pushing an Enki blog with this setup before. Here's the full error message

 Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
           Fetching gem metadata from https://rubygems.org/.......
           Could not find jquery-rails-2.0.0 in any of the sources
     !
     !     Failed to install gems via Bundler.
     !
     !     Heroku push rejected, failed to compile Ruby/rails app

After I got the error message I added this to the gemfile

gem 'jquery-rails-2.0.0'

I got this error message

Could not find gem 'jquery-rails-2.0.0 (>= 0) java' in the gems available on this machine.

I then tried to do

gem install jquery-rails

It gave me

  Successfully installed jquery-rails-2.0.2
1 gem installed
Installing ri documentation for jquery-rails-2.0.2...
Installing RDoc documentation for jquery-rails-2.0.2...

But the push didn't work, same error

   -----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.rc
       Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
       Fetching gem metadata from https://rubygems.org/.......
       Could not find jquery-rails-2.0.0 in any of the sources
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

this is the gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.6'
gem 'heroku'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem 'uglifier', '>= 1.0.3'
end

group :development, :test do
  gem 'sqlite3'
end
group :production do
  gem 'pg'
end

group :production do
  gem 'thin'
end
platforms :jruby do
  gem 'activerecord-jdbcsqlite3-adapter'
  gem 'trinidad'
  gem 'jruby-openssl'
end

gem 'jquery-rails'
#gem 'jquery-rails-2.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

# Bundle the extra gems:
gem 'RedCloth', '~> 4.2.9', :require => 'redcloth'
gem 'ruby-openid', :require => 'openid'
gem 'rack-openid', :require => 'rack/openid'
gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2
gem 'coderay'
gem 'lesstile'
gem 'formtastic'
gem 'will_paginate', '~> 3.0.2'
gem 'exception_notification', '~> 2.5.2'
gem 'open_id_authentication'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :test do
  gem 'database_cleaner'
  gem 'cucumber-rails',    :require => false
  gem 'cucumber-websteps', :require => false
  gem 'factory_girl'
  gem 'rspec'
  gem 'nokogiri', '~> 1.5.0'
  gem 'webrat'
end

group :development, :test do
  gem 'rspec-rails'
end
Leahcim
  • 40,649
  • 59
  • 195
  • 334

5 Answers5

46

I was getting this same error and fixed it using:

bundle update jquery-rails

In looking into it, it appears that jquery-rails 2.0.0 was yanked from rubygems: http://d.pr/i/cLms/1ReBI4U8 for whatever reason. So you (and I) likely happened to install jquery-rails when that gem was the most current version.

It's also wise to note that deleting your Gemfile.lock can be dangerous and not recommended in most cases. This causes all the latest versions of every gem without a version number in your Gemfile to be downloaded. If gems have been updated with API-breaking changes (happens more often than you might think), your app could break. But it also might not. Just be careful, run test cases if you have them. This has caused me more than one headache.

You can read a bit more about how bundler, Gemfile, and Gemfile.lock work (as well as guidance on how to properly upgrade certain gems) here: http://viget.com/extend/bundler-best-practices

pwightman
  • 784
  • 1
  • 4
  • 9
  • 5
    You should use this one not the one above. The one above will update rails and might break your whole app. – CafeHey Oct 19 '12 at 23:19
  • 1
    This explains why 2.0.0 was yanked: https://github.com/rails/jquery-rails/issues/62. Updating jquery-rails with no constraints bumped jquery up to 1.8.2 which my app was not quite ready to do. So I changed my Gemfile to: gem 'jquery-rails', '~> 2.0.0', then ran bundle update jquery-rails. That installed 2.0.3 which fixed the problem with less drastic changes. – Brian Deterling Nov 14 '12 at 05:21
  • I issued `bundle update jquery-rails` and all seemed to work fine. But this command updated other gems and ended up breaking a very small portion of my application. Might want to instead consider visiting http://rubygems.org/gems/jquery-rails/versions and explicitly defining a newer version than 2.0.0. – Tass Mar 06 '13 at 14:47
13

Worked for me:

  • delete the Gemfile.lock
  • removed the rails version from the line => gem 'rails' (jquery was already without a v number)
  • run the command "bundle install"
  • run also "bundle update jquery-rails" to make sure everything is updated
  • IMPORTANT, commit the new .lock file => run the "git add ." and "git commit ..."
  • push everything
2

Update: I am going through mhartl's Rails Tutorials and had to update jquery-rails, '2.0.1' in the Gemfile, to get the bundle update jquery-rails going.

Thanks, Jatin

jjello
  • 93
  • 1
  • 7
1

i had similar issue by changing in Gemfile jquery-rails-2.0.0 to 2.0.1 will solved my problem.

  • 1
    @jam in my Gemfile there was jquery-rails-2.0.0 and i replaced it with jquery-rails-2.0.1 and after i typed `bundle update` it solved my problem – whowantstolivefo Jul 26 '13 at 10:06
0

Michael,

I had to remove the version number from my jquery gem from 2.0.0 and let it pull the latest for this to work. I am on rails 3.2.8.rc2 and running on the cedar stack of heroku. Best of luck!

Mark

cipherz
  • 543
  • 6
  • 10
  • Thanks, but if I understand correctly, I don't see that would affect my situation, because there is no version number on the jquery gem in my Gemfile, and it was giving me the error. I later added a version to experiment, but then removed it when that didn't work. – Leahcim Aug 09 '12 at 15:03