How to fix Rails's warning messages with Ruby 2.7.0

前端 未结 4 1403
醉梦人生
醉梦人生 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:12

    Obviously it will take some time to for ruby team to remove all this warning in next ruby version. For now the command in your terminal

    `RUBYOPT='-W:no-deprecated' rails s` 
    

    on my basic, plain new rails 6.0.2.1 && ruby 2.7.0 project remove these two warnings lines above in a question.

    Also, with command

    RUBYOPT='-W:no-experimental' rails s
    

    you will hide warnings about experimental features.

    You can combine these two in one command like:

    RUBYOPT='-W:no-deprecated -W:no-experimental' rails s
    

    However, I tried these commands inside my old project built with rails 5.2 and ruby 2.6.4 later upgraded to rails 6.0.1 and they didn't worked well on for all warnings messages I got from different rails Active* modules and ruby gems.

    Probably we will need some time for upgrading code and gems for new latest stuff.

提交回复
热议问题