Heroku推送拒绝:在源代码中找不到jquery-rails-2.0.0

我正在尝试将一个Enki gem博客推向Heroku,我收到了一个错误

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

但是,在Gemfile中我有

 `gem 'jquery-rails'` 

我以前从来没有遇到过使用此设置推送Enki博客的问题。 这是完整的错误消息

  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 

收到错误消息后,我将其添加到gemfile中

 gem 'jquery-rails-2.0.0' 

我收到此错误消息

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

然后我试着去做

 gem install jquery-rails 

它给了我

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

但推动不起作用,同样的错误

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

这是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 

为我工作:

  • 删除Gemfile.lock
  • 从line => gem’trail’中移除了rails版本(jquery已经没有av编号)
  • 运行命令“bundle install”
  • 运行“捆绑更新jquery-rails”以确保一切都更新
  • 重要的是,提交新的.lock文件=>运行“git add”。 和“git commit …”
  • 推动一切

我得到了同样的错误,并使用以下方法修复它:

bundle update jquery-rails

在调查中,似乎jquery-rails 2.0.0从rubygems中被拉出来: http ://d.pr/i/cLms/1ReBI4U8无论出于何种原因。 因此,当gem是最新版本时,您(和我)可能碰巧安装了jquery-rails。

同样明智的是,删除Gemfile.lock可能很危险,在大多数情况下不推荐使用。 这会导致下载Gemfile中没有版本号的每个gem的所有最新版本。 如果gem已经更新了API破坏性更改(比您想象的更频繁发生),您的应用程序可能会中断。 但它也可能没有。 请小心,如果有的话运行测试用例。 这引起了我不止一次的头痛。

您可以在此处阅读有关bundler,Gemfile和Gemfile.lock如何工作的更多信息(以及如何正确升级某些gem的指导): http : //viget.com/extend/bundler-best-practices

更新:我正在浏览mhartl的Rails教程,并且必须在Gemfile中更新jquery-rails,’2.0.1’,以获得更新jquery-rails的包。

谢谢,贾丁

我有类似的问题,通过更改Gemfile jquery-rails-2.0.0到2.0.1将解决我的问题。

迈克尔,

我不得不从我的jquery gem中删除2.0.0中的版本号,然后让它拉出最新版本来实现。 我在rails 3.2.8.rc2上运行并在heroku的雪松堆栈上运行。 祝你好运!

标记