Skip to content

Instantly share code, notes, and snippets.

@allolex
Created July 14, 2015 18:16
Show Gist options
  • Select an option

  • Save allolex/b15f711cc91c9a241020 to your computer and use it in GitHub Desktop.

Select an option

Save allolex/b15f711cc91c9a241020 to your computer and use it in GitHub Desktop.
Pry.config.should_load_plugins = true
# Pry.plugins["doc"].activate!
begin
require 'awesome_print'
AwesomePrint.pry!
rescue LoadError => err
puts "no awesome_print :("
end
# Launch Pry with access to the entire Rails stack.
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead.
# If you don't, you can load it through the lines below :)
rails = File.join Dir.getwd, 'config', 'environment.rb'
if File.exist?(rails) && ENV['SKIP_RAILS'].nil?
require rails
if Rails.version[0..0] == "2"
require 'console_app'
require 'console_with_helpers'
elsif Rails.version[0..0] == "3"
require 'rails/console/app'
require 'rails/console/helpers'
else
warn "[WARN] cannot load Rails console commands (Not on Rails2 or Rails3?)"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment