Here is what I have in my rack app
#rb file
require 'pry'
class .....
#GemFile
group :development do
gem "pry"
gem "pry-nav"
end
Of course, in production it causes an error. How do make a kind of "require if"?
require 'pry' if ENV['RACK_ENV'] == 'development'
May be you can embed it inside a if block
according to docs Sinatra provides a environment variable http://www.sinatrarb.com/intro#Environments
if development?
require 'pry'
end
wherever you need to use it.
this may not be the exact solution you may be looking for just a wild guess
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With