How to fix Rails's warning messages with Ruby 2.7.0

前端 未结 4 1388
醉梦人生
醉梦人生 2021-02-02 05:33

Did anyone resolve this issue with Ruby 2.7.0?

I used rbenv and installed Ruby v2.7.0 and then created a Rails project using Rails v6.0.2

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-02 06:16

    As it's just a warning and won't affect anything, you can just suppress them. I found solution 2 to be the right fit for me.

    Option 1. Start the rails server with RUBYOPT='-W:no-deprecated' rails s

    Option 2. Set export RUBYOPT='-W:no-deprecated in your bash/zsh profile

    Option 3. Set Warning[:deprecated] = false in your ruby code

提交回复
热议问题