【问题标题】:Bundle install command error. Ruby version is 2.2.0 and Rails version is 4.1.8捆绑安装命令错误。 Ruby 版本是 2.2.0,Rails 版本是 4.1.8
【发布时间】:2018-05-06 03:10:57
【问题描述】:

运行捆绑安装命令时出错。 Ruby 版本是 2.2.0,Rails 版本是 4.1.8。环境是 Apple Mac OS Sierra (10.12.5)

Bundler could not find compatible versions for gem "activerecord":

在 Gemfile 中: Composite_primary_keys (= 7.0.15) 被解析为 7.0.15,这取决于 主动记录 (~> 4.1.7)

rails (= 4.2.4) was resolved to 4.2.4, which depends on
  activerecord (= 4.2.4)

Bundler 找不到 gem "rack" 的兼容版本: 在 Gemfile 中: 机架 (~> 1.5.3)

omniauth was resolved to 1.7.1, which depends on
  rack (< 3, >= 1.6.2)

Bundler 找不到 gem "rails" 的兼容版本: 在 Gemfile 中: 导轨 (= 4.2.4)

commands was resolved to 0.2.1, which depends on
  rails (>= 3.2.0)

model_tree was resolved to 1.0, which depends on
  rails

【问题讨论】:

    标签: ruby-on-rails ruby bundler


    【解决方案1】:

    您需要升级composite_primary_keys gem 的版本。

    将其更改为~&gt; 8.0.0,这需要 activerecord '~>4.2.0'

    gem 'composite_primary_keys',  '~> 8.0.0'
    

    参考composite_primary_keys.gemspec

    同样,对于其他宝石,您也可以这样做。

    或者,如果您不确定 gem 版本,您可以添加 gem 名称并将版本留给 bundler 处理。

    【讨论】:

      猜你喜欢
      • 2012-01-18
      • 2022-01-25
      • 2021-09-14
      • 1970-01-01
      • 1970-01-01
      • 2021-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多