2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails version update 覚書

Last updated at Posted at 2019-04-08

覚書

Rails update

Gemfileで今回updateしたいrailsのversionに変更する

-gem 'rails', '5.~.~'
+gem 'rails', '5.~.~'                                                                                                                                    
  • bundle updateする
    bundle update --conservative rails

--conservativeを使うことで共有の依存関係を更新しないでbundle updateが行える
https://bundler.io/v1.15/man/bundle-update.1.html#OPTIONS

実行すると以下のエラーが出る

Bundler could not find compatible versions for gem "actionview":
  In snapshot (Gemfile.lock):
    actionview (= 5.~.~)

  In Gemfile:
    rspec-rails was resolved to ~.~.~, which depends on
      actionpack (>= ~.~) was resolved to 5.~.~, which depends on
        actionview (= 5.~.~)

    rails .........................

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

ビビらずにIn snapshot (Gemfile.lock)の中身だけを見ていけばいい

次に打つコマンドは
bundle update --conservative rails actionview
というように落ちるたびに追加していけば良い

最終的には
bundle update --conservative rails actionview activesupport railties actionpack activemodel activerecord
こういうコマンドになるのですが、依存するgemがありすぎて実行できなかったので、まず最初にrails以外のgemを最新にしとく必要がありますね…

次回に続く!

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?