[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

"-version" produced curious result; "--version" ran as expected" -- why?

Skippy

1/28/2006 1:55:00 AM

Hi All,

I just expanded ruby-1.8.4-i386-mswin32.zip into my Utilities directory and
added it bin subdirectory to my PATH.

In a Command window, I entered/got:

F:\> ruby -version

ruby 1.8.4 (2005-12-24) [i386-mswin32]

ruby: no such file to load -- ubygems (LoadError)



F:\>


Why did ruby want to load "ubygems"? BTW, I happened to notice an
environment variable RUBYOPT set to rubygems (left over from a previous
installation, no doubt.)

I then recalled the options should have double hyphens, so --version didn't
produce that spurious line.

Any explanation? Not critical. Just curious.
--
TIA,
Richard


4 Answers

Daniel Calvelo

1/28/2006 8:02:00 PM

0

Remember that, being of UNIX lineage, ruby follows its conventions. One
of those conventions is options vs. long-options. Long options I think
were a GNU invention, intended to make command options (traditionally
one letter after hyphen) more mnemonic. Long options start with double
hyphens, and short options with one. A single double hyphen signals the
end of options. Thus the long-option equivalent of "-v" is "--version".

"-version" as an option is parsed as a compound of "-x" options with x
in v,e,r,s,i,o,n; -e -i and -r require parameters, so they should parse
the following command-line arguments as their parameters.

My guess: RUBYOPT is additional options, and is "pasted-in" the
command-line. So one of e,i options ate the "r" from 'rubygems' and
then the -r option tried to load the library 'ubygems'.

Experiment a little and you might understand exacly how the option
parameters are used, and in what order.

Daniel.

Skippy

1/28/2006 9:02:00 PM

0

Hi Daniel,

Understood! Thanks for the clear,comprehensive and timely response.

Regards,
Richard

"Daniel Calvelo" <dca.gis@gmail.com> wrote in message
news:1138478510.332905.132100@g47g2000cwa.googlegroups.com...
> Remember that, being of UNIX lineage, ruby follows its conventions. One
> of those conventions is options vs. long-options. Long options I think
> were a GNU invention, intended to make command options (traditionally
> one letter after hyphen) more mnemonic. Long options start with double
> hyphens, and short options with one. A single double hyphen signals the
> end of options. Thus the long-option equivalent of "-v" is "--version".
>
> "-version" as an option is parsed as a compound of "-x" options with x
> in v,e,r,s,i,o,n; -e -i and -r require parameters, so they should parse
> the following command-line arguments as their parameters.
>
> My guess: RUBYOPT is additional options, and is "pasted-in" the
> command-line. So one of e,i options ate the "r" from 'rubygems' and
> then the -r option tried to load the library 'ubygems'.
>
> Experiment a little and you might understand exacly how the option
> parameters are used, and in what order.
>
> Daniel.
>


The Peeler

6/29/2013 4:31:00 PM

0

On Sat, 29 Jun 2013 05:49:47 -0700, The Rectum, the resident psychopath of
sci and scj, FAKING his time zone again and IMPERSONATING his master, The
Peeler, wrote:

>> >> >> Hint: your IDIOCY is showing, The Rectum! <G>
>> >> >
>> >> > It, IS Grik anus! <B>
>> >>
>> >> In fact, your idiocy ALWAYS shows, The Rectum! <G>
>> >
>> > In, fact it, DOES The Grik anus! <B>
>>
>> And you are "proud" of it, right, you "proud idiot"! LOL
>
> RIGHT The Grik anus! LOL

The poor stupid thing admits it! LMAO!

--
bozo about "The Rectum":
"you come to us on your knees everyday, revd, begging for any kind of
attention you can get just like the sodomized attention-whore you are"
MID: <c8ae83dc-f281-4856-94ad-574326b50cb6@kn5g2000pbb.googlegroups.com>

The Peeler

6/29/2013 4:57:00 PM

0

On Sat, 29 Jun 2013 18:30:46 +0200, The Peeler
<finishingoff@themoronicRevd.invalid> wrote:

>On Sat, 29 Jun 2013 05:49:47 -0700, The Rectum, the resident psychopath of
>sci and scj, FAKING his time zone again and IMPERSONATING his master, The
>Peeler, wrote:
>
>>> >> >> Hint: my Grik IDIOCY is showing, The Rectum! <G>
>>> >> >
>>> >> > It, IS Grik anus! <B>
>>> >>
>>> >> In fact, my Grik idiocy ALWAYS shows, The Rectum! <G>
>>> >
>>> > In, fact it, DOES The Grik anus! <B>
>>>
>>> And I am "proud" of it, right, I'm a "proud idiot"! LOL
>>
>> RIGHT The Grik anus! LOL
>
>I'm SUCH a poor stupid thing that I admit it! LMAO!

How, COULD you deny it innit? LMAO1