2012-08-09 59 views
17

我试图推动的恩基宝石的博客Heroku的,我得到一个错误Heroku的推拒绝:无法找到来源jQuery的轨道-2.0.0

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

然而,在的Gemfile我

`gem 'jquery-rails'` 

,我从来没有推的恩基博客与此设置前一个问题。下面是完整的错误消息

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. 

然后我试图做

错误消息后它给了我
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 

回答

13

为我工作:

  • 删除Gemfile.lock的
  • 移除了线轨道版本=>宝石 '轨'(jQuery的已经没有AV数)
  • 运行“捆绑安装”命令
  • 也运行“捆绑更新jquery-rails”以确保一切都已更新
  • 重要的是,提交新的.lock文件=>运行“git add”。和“git的承诺......”
  • 推一切
+7

这可能是非常危险的 - 正如双头@pwightman在他/她的回答中所述。 – mraaroncruz 2012-10-19 13:13:17

0

迈克尔,

我不得不删除版本号我jquery gem从2.0.0开始,让它为此工作提供最新版本。我在rails 3.2.8.rc2上运行,并在Heroku的雪松堆栈上运行。祝你好运!

马克

+0

谢谢,但如果我理解正确,我不会看到这会影响我的情况,因为我的Gemfile中没有jquery gem的版本号,并且它给了我错误。我后来添加了一个版本来进行试验,但是当它不起作用时就将其删除。 – Leahcim 2012-08-09 15:03:50

46

我得到同样的错误和固定它使用:

bundle update jquery-rails

在寻找到它,它看来,jQuery的轨道无论出于何种原因,2.0.0被从rubygems中抽出:http://d.pr/i/cLms/1ReBI4U8。所以你(和我)可能碰巧安装jquery-rails时,该宝石是最新的版本。

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

你可以阅读一些关于这里怎么捆绑,Gemfile中,并Gemfile.lock的工作(以及如何正确地升级某些宝石指导):http://viget.com/extend/bundler-best-practices

+5

你应该使用这个不是上面的那个。上面的那个会更新轨道,并可能会破坏你的整个应用程序。 – Smickie 2012-10-19 23:19:15

+1

这解释了为什么2.0.0被抽出:https://github.com/rails/jquery-rails/issues/62。更新jQuery的铁轨没有约束撞jquery高达1.8.2,我的应用程序还没有做好准备。所以我将Gemfile更改为:gem'jquery-rails','〜> 2.0.0',然后运行包更新jquery-rails。这安装了2.0.3,它解决了较少剧烈变化的问题。 – 2012-11-14 05:21:56

+0

我发布了“捆绑更新jquery-rails”,并且所有工作都很好。但是这个命令更新了其他宝石,并最终打破了我的应用程序的一小部分。不妨考虑访问http://rubygems.org/gems/jquery-rails/versions并明确定义比2.0.0更新的版本。 – Tass 2013-03-06 14:47:20

2

更新: 我经历mhartl的滑轨教程,并且必须更新Gemfile中的jquery-rails'2.0.1',以获得捆绑更新jquery-rails。

感谢, Jatin

1

我在Gemfile中jQuery的轨道-2.0.0改为2.0.1将解决我的问题有类似的问题。

+1

@jam在我的Gemfile中有jquery-rails-2.0.0,我用jquery-rails-2.0.1替换了它,在我输入“bundle update”之后,它解决了我的问题 – whowantstolivefo 2013-07-26 10:06:37

相关问题