Command line

Can't get it to work

Page 1 of 1

5 Replies - 2126 Views - Last Post: 23 November 2009 - 09:35 AM Rate Topic: -----

#1 Minoss  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-November 09

Command line

Posted 13 November 2009 - 12:26 PM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Command line

#2 noyesa  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 27
  • Joined: 01-April 09

Re: Command line

Posted 13 November 2009 - 12:30 PM

Type
ruby -v
into 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.
Was This Post Helpful? 0
  • +
  • -

#3 Minoss  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-November 09

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
Was This Post Helpful? 0
  • +
  • -

#4 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 120
  • View blog
  • Posts: 710
  • Joined: 15-October 09

Re: Command line

Posted 16 November 2009 - 01:58 AM

View PostMinoss, 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


Did you really save the file as calc.rb? Are you running the command in the directory you have saved the file?
Was This Post Helpful? 0
  • +
  • -

#5 YamNad  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 120
  • Joined: 11-July 09

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"
Was This Post Helpful? 0
  • +
  • -

#6 jaql  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 73
  • Joined: 19-October 09

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"

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1