LoginSignup
2
0

More than 1 year has passed since last update.

Ruby on Rails 6.1.5 を Ruby 2.7.6 から Ruby 3.0.4 にあげるときにやること

Posted at

掲題の作業を実施したところ、色々とハマったので、備忘録として残しておきます。

環境

  • Ruby 2.7.6 -> 3.0.4
  • Ruby on Rails 6.1.5

Ruby 3.0.4 にあげるときに必要なこと

(WEBrick 以外を使っていない場合) WEBrick をインストールする

理由

Ruby 3.0.0 より WEBrick が標準ライブラリから削除されました。そのため、Ruby 3.0.0 以降で WEBrick を使いたい場合は、別途インストールが必要になります。

bootsnap 1.9.3 以上にする

Ruby 3.0.4 で rails s を実行すると以下のエラーが発生します。

% bundle exec rails s
$RUBY_HOME/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)

原因

Updating to 1.9.3 helped us with this issue. Thanks!

Issue に上記解決方法が書いてあるので、

% bundle update bootsnap

を実行し、bootsnap を 1.9.3 以上にすることでエラーは解消します。

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