LoginSignup
0
0

More than 5 years have passed since last update.

RMagick使っててHeroku db:migrateできなかったときの対処

Posted at

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

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'があると関係するライブラリが更新されないっぽい。
プロダクトの1周年を記念してrubyとRails最新版に追っついた。

対処:Gemfileのrequire以降を削除

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

Gemfile
gem 'rmagick', require: 'RMagick'

以下のように書き直す。

Gemfile
gem 'rmagick'

これでbundle install

これで再度herokuにプッシュまで行う

git add .

git commit -m "コメント"

git push heroku master   

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

DEPRECATION WARNING: `config.serve_static_files` is deprecated and will be removed in Rails 5.1.はエラーでなくてただの警告のようだ

ちなみにこの部分はエラーじゃないみたいでした。

rails5.1で使えなくなる機能なので今のうちに使わないようにした方がいいよという警告です。

DEPRECATION WARNING: `config.serve_static_files` is deprecated and will be removed in Rails 5.1.
Please use `config.public_file_server.enabled = true` instead.

https://teratail.com/questions/60051


Hatenaでもエラー備忘録書いてます。
エラーは食べもの。

Qiitaでも記事増やしていきたいです。
ここまで読んでくださり、ありがとうございました^^

0
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
0
0