Search code examples
ruby-on-railsrubybashirbrails-console

~/.irbrc not executed when starting irb or script/console


Here's what I've tried:

1. gem install awesome_print
2. echo "require 'ap'" >> ~/.irbrc
3. chmod u+x ~/.irbrc
4. script/console
5. ap { :test => 'value' }

Result:

NameError: undefined local variable or method `ap' for #

Solution

  • Adding "require 'rubygems'" to my ~/.irbrc file seemed to do the trick.