.rb exists in my PATHEXT system variable so it should be treated the
same as
a .exe. Anyone else encountered this?
Thanks,
Joe
Not really. PATHEXT just means that try to append those extensions to a
command you enter on the command line, and then invoke the default
opener
for that file type.
The opener for ruby could be set up to run “ruby %1”, where %1 is only
the
script file name. I don’t have a Ruby installed on my Windows boot right
now, but poke around the registry looking for what filetype the “.rb”
extension is registered to, and then search for the name of the filetype
to scrounge up what the command string is.
My memory of last doing something like this is a little vague, so no
exact
syntax - but I do think the filetype opener settings use batch file
syntax, and then you should use %* in place of % to see if it
helps.
If I execute my apps from a command line using this syntax
my_app arg1 arg2 … argx
then ARGV is empty!
.rb exists in my PATHEXT system variable so it should be treated the same as
a .exe. Anyone else encountered this?
This isn’t what I see:
C:\Temp>type abu.rb
p ARGV
C:\Temp>abu what ever you want
[“what”, “ever”, “you”, “want”]
Now, in the registry, the default value for HKEY_CLASSES_ROOT.rb is
“rbFile” and the default value for
HKEY_CLASSES_ROOT\rbFile\Shell\open\command is:
“c:\ruby\bin\ruby.exe” “%1” %*
I suspect that your registry entry is missing the %* bit. Go open up
regedit, find HKEY_CLASSES_ROOT.rb, find that default value (probably
rbFile, but if it isn’t use that value where I say “rbFile”), then
find the default on HKEY_CLASSES_ROOT\rbFile\Shell (probably “open”),
then look at the default on
HKEY_CLASSES_ROOT\rbFile\Shell\open\command and see if that includes
the %* bit. If it doesn’t, add it.
At Thu, 17 Aug 2006 09:47:39 +0900,
Daniel M. wrote in [ruby-talk:208880]:
I suspect that your registry entry is missing the %* bit. Go open up
regedit, find HKEY_CLASSES_ROOT.rb, find that default value (probably
rbFile, but if it isn’t use that value where I say “rbFile”), then
find the default on HKEY_CLASSES_ROOT\rbFile\Shell (probably “open”),
then look at the default on
HKEY_CLASSES_ROOT\rbFile\Shell\open\command and see if that includes
the %* bit. If it doesn’t, add it.
IIRC, assoc command built in cmd.exe does it. Try assoc /?.
The opener for ruby could be set up to run “ruby %1”, where %1 is only the
script file name. I don’t have a Ruby installed on my Windows boot right
now, but poke around the registry looking for what filetype the “.rb”
extension is registered to, and then search for the name of the filetype
to scrounge up what the command string is.
Thanks to everyone for your input here. My ftype entry (rb_auto_file)
was
missing the %* on the end of it. In the past this must have been
entered by
default when I setup other associations, because I have not run into
this in
the past with other, possibly unmentionable, languages…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.