Ruby2.7とRails6.0.2.1とpostgres12.1でDBを作るために以下のコマンドをたたくとすごいwarningがでた(処理は完了している)のでwaringを表示しないようにしてみる。
$ bundle exec rails db:create
/.rbenv/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/.rbenv/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/static.rb:110: warning: The called method `initialize' is defined here
/.rbenv/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/.rbenv/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifåier' is defined here
/.rbenv/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/.rbenv/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
/.rbenv/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/.rbenv/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
Created database 'XXX_development'
Created database 'XXX_test'
Ruby2.7にまだ対応していないgemがあるからでているっぽい。
一旦warningがでないようにはbashprofileに環境変数を追加する。
$ vi ~/.bash_profile
でbash_profile
を開いてexport RUBYOPT='-W:no-deprecated -W:no-experimental'
を追加するとエラーはでなくなる。
参考
https://stackoverflow.com/questions/59491848/how-to-fix-railss-warning-messages-with-ruby-2-7-0
https://tech.recruit-mp.co.jp/server-side/post-19932/