【状況】
- rubyのバージョンを
2.3.0
から2.5.0
に変更した development
モードからproduction
モードに変更。
⇒ Webサーバもローカル環境vagrantのrails s
からapache+passenger
に変更。
【エラー】
F, [2018-08-06T09:57:07.151547 #4228] FATAL -- : [5a82a46a-0671-447c-94fe-4a16fdddbd17] NoMethodError : undefined method `encrypted_password_iv=' for #<User:0x00007f55e763c128>
Did you mean? encrypted_password=
encrypted_password
encrypted_password?
encrypted_password_was
encrypted_password_change
【1日目の調査】
- データベースのマイグレーションの見直し
- ユーザ登録まわりでDeviceがrubyのバージョン違いの調査
- apache+passengerまわりの設定の見直し
行き詰まりを見せていたものの、あきらめないことが大事ですね。ヒントになる記事はインターネットという世界の中に、誰かが試したヒントが必ずあるものです。通勤の電車の中でも、ググって見つけた記事が解決に繋がるのでした。
【2日目の調査】
developmentモードとproductionモードの差分という視点で調べていて。
config/environments/development.rb
config/environments/production.rb
それぞれの環境で参照される環境の設定ファイルですが、
production.rb
にて以下のように修正。
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = false
config.eager_load:true
⇒ false
以上。