【发布时间】:2019-10-19 16:37:48
【问题描述】:
我正在尝试将我的 rails 4.2 项目升级到 5.2.3。
在执行 bundle update rails 时,出现以下错误。
Bundler 找不到 gem "faraday" 的兼容版本: 在 Gemfile 中: 法拉第 (~> 0.11.0)
faraday_middleware was resolved to 0.13.1, which depends on
faraday (>= 0.7.4, < 1.0)
oauth2 (~> 1.3.1) was resolved to 1.3.1, which depends on
faraday (>= 0.8, < 0.12)
sentry-raven was resolved to 2.9.0, which depends on
faraday (>= 0.7.6, < 1.0)
twilio-ruby was resolved to 5.23.1, which depends on
faraday (~> 0.9)
Bundler 找不到 gem "railties" 的兼容版本: 在 Gemfile 中: coffee-rails (~> 4.1.0) 被解析为 4.1.0,这取决于 railties (>= 4.0.0,
devise was resolved to 4.6.2, which depends on
railties (>= 4.1.0, < 6.0)
factory_bot_rails was resolved to 5.0.2, which depends on
railties (>= 4.2.0)
rails (= 5.2.3) was resolved to 5.2.3, which depends on
railties (= 5.2.3)
rails-i18n was resolved to 5.1.3, which depends on
railties (>= 5.0, < 6)
rspec-rails (~> 3.5, >= 3.5.2) was resolved to 3.8.2, which depends on
railties (>= 3.0)
sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
railties (>= 4.0.0, < 6)
web-console (~> 2.0) was resolved to 2.3.0, which depends on
railties (>= 4.0)
根据参考资料,我删除了 Gemfile.lock 并运行了 bundle install 但出现了同样的错误。
似乎有两个 gem 与当前的库不兼容。您对如何安全地将 rails 项目升级到 5.2.3 有什么建议吗?
【问题讨论】:
-
只需删除
Gemfile.lock并再次运行bundle install,可能对您有所帮助。 -
嗨,正如我在上面评论的那样,它没有成功,出现了同样的消息。:(
-
尝试运行一次
bundle update,如果您提到了上述任何 gem 的 gem 版本,请将其从 gemfile 中删除。 -
这真是个糟糕的建议...尝试通过“删除所有版本限制、删除
Gemfile.lock并运行bundle update”来升级复杂的旧rails 应用程序会引入大量错误.当然,它会安装 gem,但很可能应用程序实际上不会运行。 -
@SungpahLee 恢复到应用程序的工作版本。一次升级一个。确保它仍然有效,每一步。在我看来,您一直在尝试一次性升级很多东西,并且 - 在这样做时 - 您已经编辑了
Gemfile以指定与您的其他库不兼容的faraday的更高版本。
标签: ruby-on-rails ruby