Forum: Ruby command prompt problem with windows 7

Posted by Al Baker (alcheddah)
on 2012-11-02 07:52
Attachment: Untitled-1.jpg (55,9 KB)
I'm new to this, so forgive me noobishness(is that a word?) and have a
problem with my command prompt in windows 7. when I try to run a ruby
file, I get this msg "ruby: No such file or directory -- argv.rb
(LoadError)" (See ATTACHMENT).

I've done the "Add C:\ruby\bin"
trick and restarted, but it doesn't seem to work! ANY IDEAS WOULD BE
GREAT!
Posted by unknown (Guest)
on 2012-11-02 09:27
(Received via mailing list)
Am 02.11.2012 07:52, schrieb Al Baker:
> I'm new to this, so forgive me noobishness(is that a word?) and have a
> problem with my command prompt in windows 7. when I try to run a ruby
> file, I get this msg "ruby: No such file or directory -- argv.rb
> (LoadError)" (See ATTACHMENT).

Are you really sure that the file `argv.rb' is in your current
working directory?

Does it show up when you enter `dir' at the prompt?

> I've done the "Add C:\ruby\bin"
> trick and restarted, but it doesn't seem to work! ANY IDEAS WOULD BE
> GREAT!

It couldn't make a difference: the error message is issued by ruby,
so apparently there is no problem with locating the ruby interpreter.

> Attachments:
> http://www.ruby-forum.com/attachment/7846/Untitled-1.jpg

Please simply include the command (`ruby argv.rb') and the
error message in the email itself.
Posted by Al Baker (alcheddah)
on 2012-11-04 03:33
> Are you really sure that the file `argv.rb' is in your current
> working directory?
>
> Does it show up when you enter `dir' at the prompt?
>
>> I've done the "Add C:\ruby\bin"
>> trick and restarted, but it doesn't seem to work! ANY IDEAS WOULD BE
>> GREAT!
>
> It couldn't make a difference: the error message is issued by ruby,
> so apparently there is no problem with locating the ruby interpreter.
>
>> Attachments:
>> http://www.ruby-forum.com/attachment/7846/Untitled-1.jpg
>
> Please simply include the command (`ruby argv.rb') and the
> error message in the email itself.

here's what i get every time i try his. thanks again!

C:\Users\Al Baker>ruby argv.rb
ruby: No such file or directory -- argv.rb (LoadError)

C:\Users\Al Baker>dir

 Directory of C:\Users\Al Baker

10/31/2012  09:18 PM    <DIR>          .
10/31/2012  09:18 PM    <DIR>          ..
09/23/2009  05:19 PM    <DIR>          Adobe Photoshop CS 8.0
07/12/2012  11:37 PM    <DIR>          Contacts
10/31/2012  02:57 AM    <DIR>          Desktop
10/29/2012  05:38 PM    <DIR>          Documents
11/03/2012  07:56 PM    <DIR>          Downloads
11/02/2012  02:57 AM    <DIR>          Dropbox
07/12/2012  11:37 PM    <DIR>          Favorites
09/18/2012  07:09 PM    <DIR>          Links
08/30/2012  12:06 AM    <DIR>          Music
11/02/2012  02:47 AM    <DIR>          Pictures
05/16/2012  09:21 PM            65,972 PKQUARTZ full.sgm
07/12/2012  11:37 PM    <DIR>          Saved Games
07/12/2012  11:37 PM    <DIR>          Searches
07/26/2012  12:13 PM    <DIR>          temp
11/05/2011  06:53 PM    <DIR>          TOOLS
08/16/2012  02:55 PM    <DIR>          Videos
10/25/2012  01:48 AM    <DIR>          Virtual Machines
               1 File(s)         65,972 bytes
              18 Dir(s)  44,418,449,408 bytes free
Posted by Jam Bees (Guest)
on 2012-11-04 04:32
(Received via mailing list)
The file argv.rb does not exist in the directory you're running ruby 
from. cd into the directory that argv.rb exists in , execute from there, 
all will be well.
Posted by Al Baker (alcheddah)
on 2012-11-04 06:29
Jam Bees wrote in post #1082709:
> The file argv.rb does not exist in the directory you're running ruby
> from. cd into the directory that argv.rb exists in , execute from there,
> all will be well.

tried that. it didn't work

C:\Users\Al Baker>Documents\Programming\RuBy\ argv.rb
'Documents\Programming\RuBy\' is not recognized as an internal or 
external comma
nd,
operable program or batch file.
 ad i tried it without the forward slash as well.
Posted by unknown (Guest)
on 2012-11-04 09:29
(Received via mailing list)
Am 04.11.2012 06:29, schrieb Al Baker:
> Jam Bees wrote in post #1082709:
>> The file argv.rb does not exist in the directory you're running ruby
>> from. cd into the directory that argv.rb exists in , execute from there,
>> all will be well.
>
> tried that. it didn't work
>
> C:\Users\Al Baker>Documents\Programming\RuBy\ argv.rb
> 'Documents\Programming\RuBy\' is not recognized as an internal or
> external command, operable program or batch file.

you have to *change into the directory* with `cd':

$ cd Documents\Programming\RuBy
$ ruby argv.rb

You might also want to search for some command prompt tutorial.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.