Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Ruby not working on computer....

ruby

  • Please log in to reply
7 replies to this topic

#1 xmtoxm

xmtoxm

    CC Lurker

  • New Member
  • Pip
  • 9 posts

Posted 18 December 2011 - 09:05 PM

When I go to command prompt and type in...
ruby hello.rb
Thats what I saved my program as. the output is ...
hello.rb is not recognized as an internal or external command. Operable program or batch file.
I am so frustrated. Can anybody help me please?
  • 0

#2 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1310 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 18 December 2011 - 09:15 PM

Would this work?:
ruby ./hello.rb

---------- Post added at 09:15 PM ---------- Previous post was at 09:12 PM ----------

Or the other thing, did you save hello.rb in the documents folder? If so, try this:
chdir %userprofile%\documents
ruby hello.rb
  • 0

#3 xmtoxm

xmtoxm

    CC Lurker

  • New Member
  • Pip
  • 9 posts

Posted 18 December 2011 - 09:32 PM

I tried that it did not work.
Thanks though.
  • 0

#4 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1310 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 18 December 2011 - 09:36 PM

I am surprised that there is a 'ruby' command in Windows (or is it Windows?).

On my computer it's more like this:
chdir desktop
\ruby\bin\ruby file.rb

Have you tried saving the *.rb file to C:\ and then this?:
ruby \hello.rb
  • 0

#5 mebob

mebob

    CC Devotee

  • Validating
  • PipPipPipPipPipPip
  • 467 posts
  • Programming Language:C, C++, Assembly
  • Learning:PHP

Posted 19 December 2011 - 09:32 PM

If you are working on Windows it would be a good idea to add ruby's bin directory to your path. Then you can access it as just 'ruby'.
  • 0
Latinamne loqueris?

#6 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1310 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 20 December 2011 - 01:58 PM

Do OpenFile () and similar functions check the bin directory?

Because my written-from-scratch web server requires server-side scripts to have the path to the interpreter at the top like this:
#!/strawberry/perl/bin/perl.exe 

print "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"; 

[I]... some more code ... [/I]

The HTTP/1.0... response line is not required, and if omitted it would be added, but the double-"\r\n" sequence is required, and is not checked for; I'm talking about my server.

* * *

@xmtoxm: Did you find the solution yet?
  • 0

#7 xmtoxm

xmtoxm

    CC Lurker

  • New Member
  • Pip
  • 9 posts

Posted 20 December 2011 - 05:49 PM

Thanks for answering back you guys. I really appreciate it.
mebob could you explain what to add to the ruby's bin of the directory. Thanks.

RhetoricalRuvim's I have not found the solution. I have tried what you have said but no luck.
  • 0

#8 xmtoxm

xmtoxm

    CC Lurker

  • New Member
  • Pip
  • 9 posts

Posted 28 January 2012 - 10:37 AM

I finally got ruby working on my computer. "Throws confetti"
  • 0





Also tagged with one or more of these keywords: ruby