首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >升级到Rails 5,无法解决依赖关系

升级到Rails 5,无法解决依赖关系
EN

Stack Overflow用户
提问于 2018-06-16 15:26:26
回答 1查看 1.9K关注 0票数 0

从Rails 4.2.10升级到Rails 5.1.4将导致下面的错误消息。我不知道如何解决依赖关系。红宝石版本为2.5.1。Rails 4.2.10在没有问题的情况下运行,bundle upgrade运行时不返回任何错误。

更新:添加了下面的Gemfile以供参考。在执行Gemfile.lock之前删除bundle update时,仍然会生成以下错误消息。

错误消息

代码语言:javascript
复制
Bundler could not find compatible versions for gem "activemodel":
  In Gemfile:
    rails (~> 5.1.4) was resolved to 5.1.4, which depends on
      activemodel (= 5.1.4)

web-console (~> 2.0.0.beta3) was resolved to 2.0.0, which depends on
  activemodel (~> 4.0)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    jbuilder (~> 2.7.0) was resolved to 2.7.0, which depends on
  activesupport (>= 4.2.0)

rails (~> 5.1.4) was resolved to 5.1.4, which depends on
  activesupport (= 5.1.4)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (~> 5.1.4)

Could not find gem 'rails (~> 5.1.4)' in any of the sources.Bundler could not 
find compatible versions for gem "activemodel":
  In Gemfile:
    rails (~> 5.1.4) was resolved to 5.1.4, which depends on
      activemodel (= 5.1.4)

web-console (~> 2.0.0.beta3) was resolved to 2.0.0, which depends on
  activemodel (~> 4.0)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
jbuilder (~> 2.7.0) was resolved to 2.7.0, which depends on
  activesupport (>= 4.2.0)

rails (~> 5.1.4) was resolved to 5.1.4, which depends on
  activesupport (= 5.1.4)

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
rails (~> 5.1.4)

Could not find gem 'rails (~> 5.1.4)' in any of the sources.

Gemfile

代码语言:javascript
复制
source 'https://rubygems.org'

gem 'rails', '~> 5.1.4'
gem 'sass-rails'
gem 'bootstrap-sass'
gem 'bcrypt'
gem 'uglifier',     '~> 3.2.0'
gem 'coffee-rails', '~> 4.2.2'
gem 'jquery-rails', '~> 4.3.1'
gem 'turbolinks',   '~> 5.0.1'
gem 'jbuilder',     '~> 2.7.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'stripe'

group :development, :test do
  gem 'sqlite3',     '~> 1.3.9'
  gem 'byebug',      '~> 3.4.0'
  gem 'web-console', '~> 2.0.0.beta3'
  gem 'spring',      '~> 1.1.3'
end

group :test do
  gem 'minitest-reporters', '~> 1.0.5'
  gem 'mini_backtrace',     '~> 0.1.3'
  gem 'guard-minitest',     '~> 2.3.1'
end

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
  gem 'puma'
end
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-17 05:27:52

gem web控制台正在锁定您的更新过程,首先将其更改为最近的版本,如下所示:

代码语言:javascript
复制
gem 'web-console', '>= 3.3.0'

然后删除Gemfile.lock并运行bundle install,这对于检查其他gems的版本和检查rails.html中的官方Rails升级过程文档也总是有好处的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50889198

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档