I suggest writing such a method in Object or Kernel in your application:
def require_pry require 'pry' if ENV['RACK_ENV'] == 'development' end
After that, you can call require_pry if you need it in the code. But I doubt why the Bundler cannot be handled by the Bundler. Rquire will require all the gems needed for the environment.
source share