正在尝试将Rails 4.2.9应用程序更新到Rails 5.2.1。已更改Gemfile:
gem 'rails', '5.2.1'
但是Bundler似乎找不到合适的ActiveModel版本(在Gemfile中的任何地方都没有专门调用)。
我已经将下面提到的gem更新到它们的最新版本(active_model_serializers、clearance、simple_form、sanitize和capybara-angular )(更新到0.2.5,因为0.2.6违反了规范),并且测试通过了4.2.9)。
我不知道该怎么做。有什么想法?
$ bundle update rails
...
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
active_model_serializers (= 0.10.7) was resolved to 0.10.7, which depends on
activemodel (< 6, >= 4.1)
clearance (= 1.16.1) was resolved to 1.16.1, which depends on
email_validator (~> 1.4) was resolved to 1.6.0, which depends on
activemodel
rails (= 5.2.1) was resolved to 5.2.1, which depends on
activemodel (= 5.2.1)
simple_form (= 3.5.1) was resolved to 3.5.1, which depends on
activemodel (< 5.2, > 4)
Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
nokogiri (= 1.7.2)
capybara-angular (= 0.2.5) was resolved to 0.2.5, which depends on
capybara (>= 2.5.0) was resolved to 2.18.0, which depends on
nokogiri (>= 1.3.3)
sanitize (= 4.6.6) was resolved to 4.6.6, which depends on
nokogumbo (~> 1.4) was resolved to 1.5.0, which depends on
nokogiri
sanitize (= 4.6.6) was resolved to 4.6.6, which depends on
nokogiri (>= 1.4.4)
capybara-angular (= 0.2.5) was resolved to 0.2.5, which depends on
capybara (>= 2.5.0) was resolved to 2.18.0, which depends on
xpath (< 4.0, >= 2.0) was resolved to 2.1.0, which depends on发布于 2018-10-30 10:17:14
您使用的是simple_form版本3.5.1和Rails 5.2.1。version 4.0是支持Rails5.2的第一个simple_form版本。
您可以看出这就是问题所在,因为下面这行代码:
simple_form (= 3.5.1) was resolved to 3.5.1, which depends on
activemodel (< 5.2, > 4)将simple_form升级到4.0.0或更高版本,应可解决此问题。
大多数gem存储库都会包含一个记录此类兼容性问题的CHANGELOG,因此,第一步是访问gem的存储库,检查您是否拥有最新版本。(或者至少是一个兼容的)
https://stackoverflow.com/questions/53017240
复制相似问题