Ubuntu – How to access the Ruby Command line in ubuntu 14.04

railsruby

I have Installed Ruby On Rails of version 2.1.3p242 on my system. But I can't findout the ruby command line. I have searched but not found.

I have try to to check through

man ruby : Show some details

man rail : "See 'man 7 undocumented' for help when manual pages are not available."

May anybody help me to open the Ruby cmd line.

Best Answer

There are two ways of interactively using ruby on the command line (like running python or nodejs, for example):

Simply run ruby:

$ ruby
print "hello world\n"

Then press CtrlD. You will see:

hello world

The easier way is Interactive Ruby (irb):

$ irb
irb(main):001:0> print "hello\n"
hello
=> nil
irb(main):002:0> 
Related Question