Ruby Command Line

  • ruby -v – Tells us which version of Ruby is installed.
  • which ruby – Tells us where Ruby is located on the system.
  • ruby -e ‘puts 94118’ – Used to run a single line of Ruby.
  • ruby test.rb – Used to execute/run a Ruby file.
  • ri String#upcase – ri stands for Ruby Information. Used for getting documentation which is stored locally on the system on all the different classes and methods and files that are available to us in Ruby.