Jump to content

Ruby not working on computer....

- - - - -

  • Please log in to reply
7 replies to this topic

#1
xmtoxm

xmtoxm

    Newbie

  • Members
  • Pip
  • 9 posts
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?

#2
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
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

#3
xmtoxm

xmtoxm

    Newbie

  • Members
  • Pip
  • 9 posts
I tried that it did not work.
Thanks though.

#4
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
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

#5
mebob

mebob

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
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'.
Latinamne loqueris?

#6
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
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?

#7
xmtoxm

xmtoxm

    Newbie

  • Members
  • Pip
  • 9 posts
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.

#8
xmtoxm

xmtoxm

    Newbie

  • Members
  • Pip
  • 9 posts
I finally got ruby working on my computer. "Throws confetti"




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users