Skip to content

Instantly share code, notes, and snippets.

@matthuhiggins
Forked from doitian/README.md
Last active December 28, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthuhiggins/7488126 to your computer and use it in GitHub Desktop.
Save matthuhiggins/7488126 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'pry'
if ARGV.first && !ARGV.first.index("-") && env = ARGV.shift
ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
end
ARGV.unshift "console"
APP_PATH = File.expand_path('config/application')
require APP_PATH
module Rails
class Console
IRB = ::Pry
end
end
require 'rails/commands'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment