#author("2019-07-01T07:10:38+00:00","default:wikiwriter","wikiwriter") &tag(Rails/アップグレード/5.1から5.2); *目次 [#h9e0e41e] #contents *関連ページ [#v0ce57e4] *参考情報 [#w8ce8449] -[[Railsアップグレードガイド - Rails ガイド:https://railsguides.jp/upgrading_ruby_on_rails.html#rails-5-1%E3%81%8B%E3%82%89rails-5-2%E3%81%B8%E3%81%AE%E3%82%A2%E3%83%83%E3%83%97%E3%82%B0%E3%83%AC%E3%83%BC%E3%83%89]] *手順 [#e2167e1d] -GemfileのRailsのバージョンを5.2系の最新場合に書き換える。他Rails 5.2でデモアプリを作成しGemfileを比較してアップデートしたほうがよさそうなのを更新。 #pre{{ gem 'rails', '5.2.3' #gem 'mysql2', '~> 0.3.18' gem 'mysql2', '>= 0.4.4', '< 0.6.0' # Use Puma as the app server gem 'puma', '~> 3.11' gem 'bootsnap', '>= 1.1.0', require: false group :development do gem 'web-console', '>= 3.3.0' }} -bundle updateする。 bundle update -設定ファイルの更新。古い設定ファイルを上書きしようとしてくるので基本Yesで応える。後からgit diffで差分を見ながら移植したほうがよさげ。 bundle exec rails app:update -IntelliJの場合、「Git > Compare with same repository version」で比較すると変更を戻せる。 *注意点 [#q0aa8ec3] **undefined method `halt_callback_chains_on_return_false=' for ActiveSupport:Module [#a30a4a79] -[[rails 5.1.6 のアプリをrails 5.2.0にアップデートしたときに困ったとこメモ - 脱力系日記:https://tkmr.hatenablog.com/entry/2018/04/19/021252]] -new_framework_defaults.rbから以下の行を削除/コメントアウトする ActiveSupport.halt_callback_chains_on_return_false = false **couldn't find file 'ckeditor/init' with type 'application/javascript [#d8975318] -ckeditor v5.0.0の問題?以下の指定でとりあえず。 gem 'ckeditor', '4.3.0' **本番環境でアセットファイルが表示されない [#n2a1f312] -config/environments/production.rbを確認。 -たいてい以下の2つの設定を有効にすれば良い。 #pre{{ config.public_file_server.enabled = true config.assets.compile = true }}