OK well I have been following the instructions here, http://pine.fm/Learn...ram/?Chapter=01, I did everything they say. But when is says type in ruby calc.rb in the command line, it doesn't work for me. I tried typing that in the windows command prompt, and the Ruby Interactive Console, but neither work. It says, a 3 should a appear but nothing ever does.
Please Help.
Command lineCan't get it to work
Page 1 of 1
5 Replies - 1737 Views - Last Post: 23 November 2009 - 09:35 AM
Replies To: Command line
#2
Re: Command line
Posted 13 November 2009 - 12:30 PM
Type
Your might vary quite a bit, this is on my work machine and I haven't updated it in some time.
If your computer tells you that it doesn't recognize the command, then you either don't have Ruby installed or it isn't in your PATH.
ruby -vinto your command prompt. You should get something like:
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
Your might vary quite a bit, this is on my work machine and I haven't updated it in some time.
If your computer tells you that it doesn't recognize the command, then you either don't have Ruby installed or it isn't in your PATH.
#3
Re: Command line
Posted 13 November 2009 - 04:44 PM
OK, I did all of that and I got exactly this ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32], like you. But when I type in ruby calc.rb, it says "ruby: No such file of directory -- calc.rb (LoadError)."
Thanks
Thanks
#4
Re: Command line
Posted 16 November 2009 - 01:58 AM
Minoss, on 13 Nov, 2009 - 03:44 PM, said:
OK, I did all of that and I got exactly this ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32], like you. But when I type in ruby calc.rb, it says "ruby: No such file of directory -- calc.rb (LoadError)."
Thanks
Thanks
Did you really save the file as calc.rb? Are you running the command in the directory you have saved the file?
#5
Re: Command line
Posted 20 November 2009 - 12:54 PM
You need to make sure you're running the command in the same directory you have the calc.rb file.
Type "cd " then the directory calc.rb is in to change it.
Then just do "ruby calc.rb"
Type "cd " then the directory calc.rb is in to change it.
Then just do "ruby calc.rb"
#6
Re: Command line
Posted 23 November 2009 - 09:35 AM
Also, if you're trying to load a file from irb, make sure you're in the directory with the file in it when you start up irb. Then you can do:
load "filename.rb"
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|