# Issue with uninitialized constant ARG (NameError)

**URL:** <https://www.ruby-forum.com/t/issue-with-uninitialized-constant-arg-nameerror/133292>\
**Category:** Ruby\
**Created:** [March 29, 2008, 7:52pm UTC](https://www.ruby-forum.com/t/issue-with-uninitialized-constant-arg-nameerror/133292 "2008-03-29T19:52:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7c8e57/32.png) [@tuka](https://www.ruby-forum.com/u/tuka)\
**Post date:** [March 29, 2008, 7:52pm UTC](https://www.ruby-forum.com/t/issue-with-uninitialized-constant-arg-nameerror/133292/1 "2008-03-29T19:52:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tuka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7c8e57/32.png) [@tuka](https://www.ruby-forum.com/u/tuka)\
**Post date:** [March 29, 2008, 7:58pm UTC](https://www.ruby-forum.com/t/issue-with-uninitialized-constant-arg-nameerror/133292/2 "2008-03-29T19:58:53Z")

</div>

Tuka O. 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…

---

<div class="post-metadata">

**Author:** ![tuka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7c8e57/32.png) [@tuka](https://www.ruby-forum.com/u/tuka)\
**Post date:** [March 30, 2008, 12:40am UTC](https://www.ruby-forum.com/t/issue-with-uninitialized-constant-arg-nameerror/133292/3 "2008-03-30T00:40:41Z")

</div>

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 H. wrote:

> Tuka O. 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…
