从Rails 3.2.22升级到Rails 4.2.4时出错

Cra*_*tow 5 ruby ruby-on-rails bundler gemfile ruby-on-rails-4

我正在尝试使用Ruby 2.2.3将我们的应用程序从Rails 3.2.22升级到Rails 4.2.4.

这是我到目前为止所做的:

  1. 修改了Gemfile来指定 rails, "~> 4.2.4"
  2. bundle
  3. bundle update rails

完整的成绩单如下.

我们的Gemfile中没有指定ActiveRecord,所以我不明白它锁定了什么或在哪里修复它?

Craigs-MacBook-Pro~/Work/mbc(master|?) % git checkout -b rails-424
Switched to a new branch 'rails-424'
Craigs-MacBook-Pro~/Work/mbc(rails-424|?) % vim Gemfile
Craigs-MacBook-Pro~/Work/mbc(rails-424|?1) % bundle
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
You have requested:
  rails ~> 4.2.4

The bundle currently has rails locked at 3.2.22.
Try running `bundle update rails`
Craigs-MacBook-Pro~/Work/mbc(rails-424|?1) % bundle update rails
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies............
Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    activerecord (< 4.3, >= 3.1) ruby

    activerecord (< 5.0, >= 3.0) ruby

    vestal_versions (>= 0) ruby depends on
      activerecord (~> 3.0) ruby

    activerecord (> 3.0.0) ruby

    rails (~> 4.2.4) ruby depends on
      activerecord (= 4.2.4) ruby
Craigs-MacBook-Pro~/Work/mbc(rails-424|?1) % 
Run Code Online (Sandbox Code Playgroud)

asi*_*niy 1

vestal_versionsgem 依赖于ActiveRecord 3.0.

您需要vestal_versions在 Gemfile 中取消指定 gem 的版本,或者指定2.0.0然后:

bundle update rails vestal_versions
Run Code Online (Sandbox Code Playgroud)