Reputation: 1495
I've tried using Ruby 2.0 x64 and Ruby 1.9.3 for Windows using RubyInstaller. Entering ruby -v
works as expected, and running gem
gives me the expected usage docs. Running and using the Interactive Ruby application works as expected. I am running Windows 8.1 Update.
However, for both installations, running ruby
from cmd gives me a blank prompt where I can type, but nothing is executed when I press enter. If I attempt to install a gem, there is a similar issue where the program is running, but there is absolutely no output, and nothing happens.
I can't seem to be able to find a similar issue elsewhere. Does anyone know what might be wrong, and how I could fix it?
Upvotes: 1
Views: 1101
Reputation: 19855
What did you expect to happen? ruby.exe is the ruby interpreter, meant for running ruby scripts. Normally, to use it you would create a file containing valid ruby commands with your favorite text editor (but not a word processor). If you save the file as foobar.rb
, typing ruby foobar.rb
(or if you told the installer to associate .rb files with ruby, typing just foobar.rb
) will execute the commands in the file as a script/program. If you don't supply a script file name, ruby goes into input mode and expects you to type in a program on the spot. It won't give any feedback until you indicate end-of-file by typing CTRL-z, at which point it will process what you typed and most likely tell you about all the errors you made. If you want line-by-line interactive feedback, use irb
.
Upvotes: 1