0

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

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 并解决了所有依赖错误,但这一个我似乎无法解决。

这是我的宝石文件:

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 中是否缺少一些东西来解决这个问题?抱歉,如果没有很好地解释,我是新手(我花了几个小时试图自己解决这个问题!)

4

1 回答 1

0

有很多关于依赖关系的Gemfile信息Error

railties (= 5.0.0) 被解析为 5.0.0,这取决于 actionpack (= 5.0.0)

simple_form (~> 3.0.2) 被解析为 3.0.2,这取决于 actionpack (~> 4.0)

~>这将版本限制为可能版本的子集。阅读它。

因此,您可以从 error 中读取,这simple_form取决于 from actionpack,它只能是 4.0 到 4.1 版本。但至少railties取决于5.0 版。actionpack

要解决此问题,您必须更新simple_formgem。例如版本3.2.1具有下一个规范actionpack

s.add_dependency('actionpack', '> 4', '< 5.1')
于 2016-07-07T01:54:48.770 回答