安装旧的Ruby Gems时出现问题

时间:2018-12-06 12:40:19

标签: ruby-on-rails ruby

我正在尝试安装红宝石宝石,并遇到以下问题。请提出建议。我是Ruby n Rails的新手。现在我正在使用Ruby 2.0.0。

Bundler could not find compatible versions for gem "nokogiri":
  In Gemfile:
    nokogiri (~> 1.5)

    fog (~> 1.23.0) was resolved to 1.23.0, which depends on
      nokogiri (~> 1.5, >= 1.5.11)

Bundler could not find compatible versions for gem "ruby":
  In Gemfile:
    ruby (~> 2.0.0.0)

    nokogiri (~> 1.5) was resolved to 1.8.5, which depends on
      ruby (>= 2.1.0)

Bundler could not find compatible versions for gem "sprockets":
  In Gemfile:
    activeadmin-wysihtml5 was resolved to 1.0.0, which depends on
      activeadmin-dragonfly was resolved to 0.0.2, which depends on
        activeadmin was resolved to 2.0.0.alpha, which depends on
          sprockets (>= 3.0, < 4.1)

    sass-rails (~> 4.0.3) was resolved to 4.0.3, which depends on
      sprockets (~> 2.8, <= 2.11.0)

1 个答案:

答案 0 :(得分:0)

作为最简单的解决方案,我建议从Gemfile中删除版本,而不是编写

gem 'nokogiri', '~> 1.5'

仅使用

gem 'nokogiri'

对于所有冲突的宝石都相同。然后尝试重新运行您bundle install。这将使Bundler有更多的可能性来找到合适的版本。正确安装所有依赖项后,只需根据Gemfile.lock

修复gem版本