如何解决RoR - Bundler 找不到 gem 的兼容版本
我正在开发 Ruby on Rails 应用程序。我正在尝试将 rails 版本从 4.2 升级到 5.0
我更改了引擎 gemspec 文件中的 rails 依赖项。
在引擎中运行 bundle update
时显示以下错误 -
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
engine was resolved to 0.0.1,which depends on
rails (~> 5.0) was resolved to 5.2.4.4,which depends on
actionmailer (= 5.2.4.4)
simple_token_authentication was resolved to 1.17.0,which depends on
actionmailer (>= 3.2.6,< 7)
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
engine was resolved to 0.0.1,which depends on
actionpack (= 5.2.4.4)
rspec-rails was resolved to 4.0.2,which depends on
actionpack (>= 4.2)
simple_token_authentication was resolved to 1.17.0,which depends on
actionpack (>= 3.2.6,< 7)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
paranoia (~> 2.2) was resolved to 2.4.3,which depends on
activerecord (>= 4.0,< 6.2)
engine was resolved to 0.0.1,which depends on
activerecord (= 5.2.4.4)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
factory_girl_rails was resolved to 4.9.0,which depends on
factory_girl (~> 4.9.0) was resolved to 4.9.0,which depends on
activesupport (>= 3.0.0)
engine was resolved to 0.0.1,which depends on
activesupport (= 5.2.4.4)
rspec-rails was resolved to 4.0.2,which depends on
activesupport (>= 4.2)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
engine was resolved to 0.0.1,which depends on
activeadmin (= 1.0.0.pre2) was resolved to 1.0.0.pre2,which depends on
rails (>= 3.2,< 5.0)
engine was resolved to 0.0.1,which depends on
rails (~> 5.0)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
factory_girl_rails was resolved to 4.9.0,which depends on
railties (>= 3.0.0)
engine was resolved to 0.0.1,which depends on
railties (= 5.2.4.4)
rspec-rails was resolved to 4.0.2,which depends on
railties (>= 4.2)
我试图删除引擎的 gemfile.lock 并运行命令 bundle install
然后它显示以下错误 -
Bundler could not find compatible versions for gem "rails":
In Gemfile:
engine was resolved to 0.0.1,< 5.0)
engine1 was resolved to 0.0.1,which depends on
engine2 was resolved to 0.0.1,which depends on
rails (~> 5.0)
有人知道如何解决吗?请帮忙!
解决方法
重新阅读错误消息,它准确地说明了发生了什么。
Bundler could not find compatible versions for gem "rails":
没有单一版本的 Rails 可以满足所有要求。从您的问题描述中,我看到您正在尝试更新到 5,所以让我们看看 5 有什么问题。
In Gemfile:
engine was resolved to 0.0.1,which depends on
activeadmin (= 1.0.0.pre2)
引擎依赖于具有固定版本的 activeadmin
was resolved to 1.0.0.pre2,which depends on
rails (>= 3.2,< 5.0)
此版本需要至少 3.2 且小于 5.0 的 rails。这不允许使用 rails 5。在使用引擎更新应用程序中的 rails 之前,您需要更新引擎中的 activeadmin。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。