appacademy / dotfiles

Get your computer ready for App Academy!
22 stars 30 forks source link

`alias irb='pry'` is not the True Path #3

Closed Supernats closed 9 years ago

Supernats commented 9 years ago

Pry is fantastic, but counting on an alias to deliver its deliciousness is brittle. Instead, one should set it up with a .irbrc file. This has the added benefit of rails c always running through Pry as well. Here's what mine looks like.

begin
  require "pry"
  Pry.start
  exit
rescue LoadError => e
  warn "=> Unable to load pry"
end
davidrunger commented 9 years ago

Thanks! I added a helpful message for the students about adding pry to their Gemfiles.

# ...
rescue LoadError => e
  warn "=> Unable to load pry; using IRB instead. To use pry for Rails console,"
  warn "   add `gem 'pry', :group => :development` to your Gemfile."
end