Ruby - 无法解决与 actionpack 的依赖关系

Ruby - Unable to resolve dependencies with actionpack

我进行了捆绑安装和捆绑更新,发现我在终端中不断收到相同的错误:

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)

我更新了很多 gem 并解决了所有的依赖错误,但我似乎无法解决这个问题。

这是我的 gemfile:

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 中是否缺少解决此问题的内容? 如果没有很好地解释,我深表歉意,我是新手(我花了几个小时试图自己解决这个问题!)

GemfileError 中有很多关于依赖项的信息。

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)

~> 这将版本限制为可能版本的一个子集。 Read about it.

所以从错误中你可以读到,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')