Only a couple of changes are necessary. Not sure I love the config/application.rb
change...
Created
January 14, 2021 21:00
-
-
Save cluesque/a5a9720f082aa32a38cce08469c3a076 to your computer and use it in GitHub Desktop.
For rails console pry is a much better REPL than IRB, so why not use it in production?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your typical config/application.rb | |
module MyApplication | |
class Application < Rails::Application | |
# ... probably lots of other stuff | |
console do | |
require 'pry' | |
config.console = Pry | |
end | |
# ... | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This goes at global scope (remove it from your other groups) | |
gem 'pry-rails', require: false | |
gem 'pry-byebug', require: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/pry.rb | |
unless Rails.env.production? | |
require 'pry' # support binding.pry breakpoints in development and test | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment