我做了一个捆绑安装和捆绑包更新,发现我在终端中不断收到相同的错误:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
actionpack (~> 5.0.0)
rails (~> 5.0.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0) was resolved to 5.0.0, which depends on
actionpack (= 5.0.0)
rails (~> 5.0.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0) was resolved to 5.0.0, which depends on
actionpack (= 5.0.0)
rails (~> 5.0.0) was resolved to 5.0.0, which depends on
railties (= 5.0.0) was resolved to 5.0.0, which depends on
actionpack (= 5.0.0)
simple_form (~> 3.0.2) was resolved to 3.0.2, which depends on
actionpack (~> 4.0)
我更新了很多宝石并解决了所有依赖项错误,但这个我似乎无法解决。
这是我的宝石文件:
source 'https://rubygems.org'
gem 'rails', '~> 5.0.0'
gem 'sqlite3'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0.5'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'simple_form', '~> 3.0.2'
gem 'devise', '~> 4.2'
gem 'haml', '~> 4.0.5'
group :development, :test do
gem 'byebug', platform: :mri
end
group :development do
gem 'web-console'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
我的宝石文件中是否缺少解决此问题的内容?抱歉,如果这没有得到很好的解释,我是一个新手(并花了几个小时试图自己解决这个问题!
Gemfile
和Error
中有很多关于依赖项的信息。
轨道 (= 5.0.0) 已解析为 5.0.0,这取决于 操作包 (= 5.0.0)
simple_form (~> 3.0.2) 已解析为 3.0.2,这取决于 操作包 (~> 4.0)
~>
这会将版本限制为可能版本的子集。阅读有关它的信息。
因此,您可以从错误中读取,simple_form
取决于 actionpack
,只能从 4.0 到 4.1 版本。但railties
至少取决于actionpack
5.0 版。
要解决此问题,您必须更新 simple_form
gem。例如,版本 3.2.1
具有下一个actionpack
规范:
s.add_dependency('actionpack', '> 4', '< 5.1')