The command "ruby" does nothing on my Mac The command "ruby" does nothing on my Mac ruby ruby

The command "ruby" does nothing on my Mac


Ruby command itself will just behave the way you said, either provide it with script file or use the -e option:

ruby -e ' puts "hello world" '

However I suspect that you want the IRB(interactive ruby). Run irb in your shell.


What are you trying to do, exactly? The ruby command expects input, in most cases a file that contains Ruby code that you want it to run. In that case you have to specify the name of the file:

> ruby my_ruby_file.rb

If instead you want to run the interactive Ruby shell, i.e. the REPL console that you can type Ruby code into and have it executed each time you press enter, the command you want is irb.