【问题标题】:Heroku push rejected: can't find jquery-rails-2.0.0 in sourcesHeroku 推送被拒绝:在源中找不到 jquery-rails-2.0.0
【发布时间】:2012-08-09 04:23:37
【问题描述】:

我正在尝试将 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

这是宝石文件

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

【问题讨论】:

    标签: ruby-on-rails heroku


    【解决方案1】:

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

    bundle update jquery-rails

    在调查中,jquery-rails 2.0.0 似乎是从 ruby​​gems 中删除的: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

    【讨论】:

    • 你应该使用这个而不是上面的那个。上面的那个会更新 rails 并且可能会破坏你的整个应用程序。
    • 这解释了为什么 2.0.0 被拉出:github.com/rails/jquery-rails/issues/62。在没有约束的情况下更新 jquery-rails 将 jquery 提升到 1.8.2,而我的应用程序还没有做好准备。所以我将我的 Gemfile 更改为:gem 'jquery-rails', '~> 2.0.0',然后运行 ​​bundle update jquery-rails。那安装了 2.0.3,它以不太剧烈的变化解决了这个问题。
    • 我发布了bundle update jquery-rails,一切似乎都运行良好。但是这个命令更新了其他 gem,最终破坏了我应用程序的一小部分。可能要考虑访问 rubygems.org/gems/jquery-rails/versions 并明确定义比 2.0.0 更新的版本。
    【解决方案2】:

    为我工作:

    • 删除 Gemfile.lock
    • 从行中删除了 rails 版本 => gem 'rails'(jquery 已经没有 v 号)
    • 运行命令“捆绑安装”
    • 同时运行“bundle update jquery-rails”以确保所有内容都已更新
    • 重要,提交新的 .lock 文件 => 运行“git add ”。和“git commit ...”
    • 推动一切

    【讨论】:

    • 这可能非常危险 - 正如两位 @pwightman 在他/她的回答中所说的那样。
    【解决方案3】:

    更新: 我正在阅读 mhartl 的 Rails 教程,并且必须更新 Gemfile 中的 jquery-rails '2.0.1',才能让包更新 jquery-rails 继续运行。

    谢谢, 贾廷

    【讨论】:

      【解决方案4】:

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

      【讨论】:

      • @jam 在我的 Gemfile 中有 jquery-rails-2.0.0,我用 jquery-rails-2.0.1 替换它,在我输入 bundle update 后它解决了我的问题
      【解决方案5】:

      迈克尔,

      我必须从 2.0.0 中删除我的 jquery gem 中的版本号,并让它拉出最新版本才能正常工作。我在 rails 3.2.8.rc2 并在 heroku 的雪松堆栈上运行。祝你好运!

      标记

      【讨论】:

      • 谢谢,但如果我理解正确,我认为这不会影响我的情况,因为我的 Gemfile 中的 jquery gem 上没有版本号,它给了我错误。后来我添加了一个版本进行实验,但当它不起作用时将其删除。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 2021-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      相关资源
      最近更新 更多