#author("2021-12-22T07:05:54+00:00","default:src128","src128")
#author("2021-12-24T06:22:24+00:00","default:src128","src128")
&tag(Rails/アップグレード/6.0から6.1);
*目次 [#y7644e99]
#contents
*関連ページ [#de2dcf67]
*参考情報 [#f1327060]

*概要 [#jaf9f190]
-Rails 6.1はRuby 3以降に対応しているらしいが同時に実行している混乱するのでRuby 2.7環境のままアップグレードすることに。

*手順 [#be21ef8e]
-GemfileのRailsのバージョンを6.0系の最新版に置き換える。
-他、Rails 6.1でデモアプリを作成しGemfileを比較してアップデートしたほうがよさそうなのを更新。
#pre{{
ruby '2.7.5'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.4', '>= 6.1.4.4'
# Use mysql as the database for Active Record
gem 'mysql2', '~> 0.5'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false
}}
-bundle updateする
 bundle update
-設定ファイルの更新。古い設定ファイルを上書きしようとしてくるので基本Yesで応える。後からgit diffで差分を見ながら移植したほうがよさげ。
 bundle exec rails app:update
-IntelliJの場合、「Git > Compare with same repository version」で比較すると変更を戻せる。
-webpackerのinstall
 bundle exec rails webpacker:install


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS