|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I have a really wierd issue going on with command line on windows: I have 2 files C:\Data\Projects\Ruby\tests>ruby ParseTest.rb source.csv source.csv target.au3 C:\Data\Projects\Ruby\tests>ruby StringTest.rb source.csv StringTest.rb:12: uninitialized constant ARG (NameError) ParseTest.rb contains: # Parsing Test - Ruby CB 21.3 #puts 'This program will output the command line arguments word by word' #ARGV.each {|line| puts line} puts ARGV[0] puts ARGV[1] ----------------------------------------- StringTest.rb contains: # the first commandline argument is the source file # the 2nd argument is the target file puts ARGV[0] puts ARGV[1] #Get the arguments and assign as files sourceFilename = ARGV[0] targetFilename = ARGV[1] What is the issue here ? Seems more todo with the environment... TIA, Tuka -- Posted via http://www.ruby-forum.com/. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Tuka Opaleye wrote:
> C:\Data\Projects\Ruby\tests>ruby StringTest.rb source.csv > StringTest.rb:12: uninitialized constant ARG (NameError) > [...] > StringTest.rb contains: > > # the first commandline argument is the source file > # the 2nd argument is the target file > > puts ARGV[0] > puts ARGV[1] > > #Get the arguments and assign as files > sourceFilename = ARGV[0] > targetFilename = ARGV[1] Did you copy and paste that? Because the error message complains about ARG, but there's only ARG*V* in the code - which doesn't make any sense... -- Jabber: sepp2k@jabber.org ICQ: 205544826 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Thanks Sebastian,
That is what I needed. My Bad and some confusion with the editor I am using... I was editing a similarly named file elsewhere and running the errant file yielding the same bad result. Thanks again, Tuka Sebastian Hungerecker wrote: > Tuka Opaleye wrote: >> >> #Get the arguments and assign as files >> sourceFilename = ARGV[0] >> targetFilename = ARGV[1] > > Did you copy and paste that? Because the error message complains about > ARG, > but there's only ARG*V* in the code - which doesn't make any sense... -- Posted via http://www.ruby-forum.com/. |
|
![]() |
| Outils de la discussion | |
|
|