How can I run all Ruby scripts with warnings?

后端 未结 1 1097
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 11:42

How can I always run Ruby scripts with warnings turned on by default, by modifying my Unix or Windows environment variables?

Ideally this should work even when I\'m

1条回答
  •  囚心锁ツ
    2021-01-03 12:05

    The RUBYOPT environment variable defines default options like warnings, etc.

    Unix/OS X/etc:

    export RUBYOPT=-w
    

    You can put this in your startup script in Unix so it's set for new shells.

    Windows:

    set RUBYOPT=-w
    

    Use the system properties dialog to set it for new shells/command windows.

    0 讨论(0)
提交回复
热议问题