I'm a Ruby newbie and have Ruby 1.9.3 installed on an Ubuntu 12.04 machine.
Whenever I run the ruby
command in the terminal with no arguments, it just hangs and does nothing. It does the same thing on my Windows XP installation.
Is this the expected behavior? Coming from a Python/Java background I expected some kind of output.
This is expected. When you run just ruby
, it sits there, waiting for a program from STDIN, followed by an end-of-file character, after which it executes the program.
If you want interactive, like when you run python
, you want Ruby's irb
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With