RUBYOPT -S RuntimeError

I’m confused.

On Windows7, Ruby 1.9.3

I do : ruby -S script.rb
and it works correctly, and searches the PATH variable

However, if I do :
ruby script.rb
=>ruby: invalid switch in RUBYOPT: -S (RuntimeError)

What am I missing ?

Same behaviour on 1.8.6 on HPUX.

On Jul 4, 2013, at 4:21 PM, Tadeusz B. [email protected] wrote:

=>ruby: invalid switch in RUBYOPT: -S (RuntimeError)

What am I missing ?

Posted via

So, in ruby’s man page, I see the following:

RUBYOPT Additional Ruby options.

                       RUBYOPT="-w -Ke"

                 Note that RUBYOPT can contain only -d, -E, -I, -K, 

-r, -T, -U, -v, -w, -W, --debug,
–disable-FEATURE and --enable-FEATURE.

It doesn’t look as though RUBYOPT works with -S

Thanks for that.
I managed to find that reference when I googled for an updated version
of the man pages. It was difficult to find unless you included “man
page” in the search.

In the Programming Ruby book, it only says that option -S (among others)
is not allowed if $SAFE >= 1

I guess that it makes sense not to have -S in a variable.