无法将Rails 5.1.2更新到5.2.3

时间:2019-05-24 19:44:22

标签: ruby-on-rails

我是Rails的新手,我正在尝试更新项目中的Rails。

我更改了gem 'rails', '~> 5.2.3'

对于我的Gemfile中的gem 'rails', '~> 5.2.3'

执行bundle update rails并得到

Bundler could not find compatible versions for gem "activerecord":
   In Gemfile:
    administrate (~> 0.8.1) was resolved to 0.8.1, which depends on
       activerecord (>= 4.2, < 5.2)

     administrate (~> 0.8.1) was resolved to 0.8.1, which depends on
       kaminari (>= 1.0) was resolved to 1.1.1, which depends on
         kaminari-activerecord (= 1.1.1) was resolved to 1.1.1, which depends on
           activerecord

     rails (~> 5.2.3) was resolved to 5.2.3, which depends on
       activerecord (= 5.2.3)

我尝试删除Gemfile.lock并执行bundle install并得到:

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    active_model_serializers (~> 0.10.6) was resolved to 0.10.9, which depends on
      actionpack (>= 4.1, < 6)

    administrate (~> 0.8.1) was resolved to 0.8.1, which depends on
      actionpack (>= 4.2, < 5.2)

    rails (~> 5.2.3) was resolved to 5.2.3, which depends on
      actionpack (= 5.2.3)

    rspec-rails (~> 3.5) was resolved to 3.8.2, which depends on
      actionpack (>= 3.0)

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

     administrate-field-carrierwave (~> 0.2.0) was resolved to 0.2.0, which depends on
       administrate (< 1.0.0)

     administrate-field-ckeditor (~> 0.0.9) was resolved to 0.0.9, which depends on
       administrate (>= 0.3, < 1.0)

并且没有创建Gemfile.lock

1 个答案:

答案 0 :(得分:0)

运行bundle update

然后运行bundle install来处理对Gemfile的更改,并且bundle update升级已经由Bundler管理的宝石。