我正在尝试将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
答案 0 :(得分:46)
我收到同样的错误并使用以下方法修复:
bundle update jquery-rails
在调查中,似乎无论出于何种原因,jquery-rails 2.0.0都被rubygems:http://d.pr/i/cLms/1ReBI4U8拉了出来。所以当你的宝石是最新的版本时,你(和我)可能碰巧安装了jquery-rails。
同样明智的是,删除Gemfile.lock
可能会很危险,在大多数情况下不建议这样做。这会导致下载Gemfile中没有版本号的每个gem的所有最新版本。如果宝石已经使用API破坏性更改进行更新(比您想象的更频繁发生),您的应用可能会中断。但它也可能没有。请小心,如果你有测试用例,请运行测试用例。这引起了我不止一次的头痛。
您可以在此处阅读有关bundler,Gemfile和Gemfile.lock如何工作的更多信息(以及如何正确升级某些宝石的指导):http://viget.com/extend/bundler-best-practices
答案 1 :(得分:13)
为我工作:
答案 2 :(得分:2)
更新: 我正在浏览mhartl的Rails Tutorials并且不得不在Gemfile中更新jquery-rails,'2.0.1',以获得更新jquery-rails的包。
谢谢, Jatin
答案 3 :(得分:1)
我有类似的问题,通过更改Gemfile jquery-rails-2.0.0到2.0.1将解决我的问题。
答案 4 :(得分:0)
我不得不从我的jquery gem中删除2.0.0中的版本号,然后让它拉出最新的版本号。我在rails 3.2.8.rc2上运行并在heroku的雪松堆栈上运行。祝你好运!
标记