【问题标题】:Cannot push to heroku since latest Nokogiri gem update自从最新的 Nokogiri gem 更新以来无法推送到 heroku
【发布时间】:2016-12-28 22:31:48
【问题描述】:

在 2016 年 12 月 27 日 Nokogiri gem 更新之前,一切似乎都很好,这就是它在 heroku 日志中所说的内容,我似乎无法找到解决方法。它适用于开发,它只是不推向heroku。提前谢谢你

    enter code here.
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.13.6
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
       Fetching gem metadata from https://rubygems.org/..........
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Resolving dependencies...
       nokogiri-1.7.0 requires ruby version >= 2.1.0, which is incompatible with the
       current version, ruby 2.0.0p648
       Bundler Output: Fetching gem metadata from https://rubygems.org/..........
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Resolving dependencies...
       nokogiri-1.7.0 requires ruby version >= 2.1.0, which is incompatible with the
       current version, ruby 2.0.0p648
 !
 !     Failed to install gems via Bundler.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

【问题讨论】:

  • nokogiri-1.7.0 requires ruby version >= 2.1.0, which is incompatible with the current version, ruby 2.0.0p648
  • 是的,我知道这是问题所在,但这是我的问题,如果我更新 ruby​​,该应用程序似乎在其他领域出现问题,所以处理起来更麻烦,而且我没有我的 gemfile 中的 nokogiri,它只是 gemfile.lock 中的一个依赖项。我真的不知道该怎么做才能解决它
  • 您可以在 gemfile 中设置 nokogiri 的版本限制

标签: ruby-on-rails ruby git heroku


【解决方案1】:

您可以将 gemfile 更新为兼容的版本: 例如:

gem 'nokogiri', '~> 1.5.9'

【讨论】:

    猜你喜欢
    • 2023-04-03
    • 1970-01-01
    • 2011-11-16
    • 1970-01-01
    • 1970-01-01
    • 2016-12-14
    相关资源
    最近更新 更多