Passing Ruby interpreter arguments with hashbang command

陌路散爱 提交于 2019-12-08 01:52:35

问题


I am using the following hashbang command with my RVM installation. How do I pass the -w argument to the ruby interpreter?

#!/usr/bin/env ruby

Thanks.


回答1:


I recommend setting the RUBYOPT environment variable. In this manner, you don't have to edit your executables.

RUBYOPT="-w $RUBYOPT"



回答2:


According to this reference you can use a separate declaration outside of the shebang for that:

#! /usr/bin/env ruby
$VERBOSE=true


来源:https://stackoverflow.com/questions/17460206/passing-ruby-interpreter-arguments-with-hashbang-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!