razzi.abuissa.net

Razzi's guide to Ruby

(I’m a ruby beginner)

debug your ruby code

Say you have a method like so:

def rere(soso)
  puts soso
end

You can get inside it by adding binding.irb:

def rere(soso)
  binding.irb
  puts soso
end

Now when you run the method you’ll get a full debugging console:

$ ruby code.rb

From: code.rb @ line 2 :

    1: def soso(gogo)
 => 2:   binding.irb
    3:   puts gogo
    4: end
    5:
    6: soso 333

irb(main):001> gogo
=> 333

Add ruby gems executables to path

Add this line to ~/.profile and reload your profile:

export PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"