エラーは食べもの。

WPへ引越。こちらは改装中。。。

RMagick使っててHeroku db:migrateが失敗するときの対処

移転しました。3秒後に移転先へ移動します。

以前の記事で、herokuプッシュまでは無事できたわけですが、

http://nojishio-notes.hatenablog.com/entry/2018/08/05/230000nojishio-notes.hatenablog.com


その次、heroku run rake db:migrateをしようとして発生したエラー。

なんかいろいろ言ってる…

Running: rake assets:precompile
remote:        /tmp/build_907cf6c8c9a568c0a7a61f789baceb04/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
remote:        /tmp/build_907cf6c8c9a568c0a7a61f789baceb04/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
remote:        [DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead
remote:        /tmp/build_907cf6c8c9a568c0a7a61f789baceb04/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
remote:        DEPRECATION WARNING: `config.serve_static_files` is deprecated and will be removed in Rails 5.1.
remote:        Please use `config.public_file_server.enabled = true` instead.
remote:         (called from block in <top (required)> at /tmp/build_907cf6c8c9a568c0a7a61f789baceb04/config/environments/production.rb:25)


作業環境

  • Rails 5.0.1
  • Ruby 2.5.0
  • mysql2 0.4.10 (ローカル環境) 

エラー:[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead

いろいろ書いてあるんだけど、どうやらここらしい。

[DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead


require: 'RMagick'があると関係するライブラリが更新されないっぽい。

対処:Gemfileのrequire以降を削除

ということでGemfileのここの記述を

gem 'rmagick', require: 'RMagick'

以下のように書き直す。

gem 'rmagick'

これでbundle install

これで再度herokuにプッシュまで行う
git add .
git commit -m "コメント"
git push heroku master   

heroku run rake db:migrate  これで成功!!
heroku open


Qiitaでも書きました↓

ここまで読んでくださり、ありがとうございました^^