how to not require certain gems/lines of code in production that I need in development

I am not writing in Rails. It is just ruby.

But I have a dev environment that has it’s own development group in the Gemfile.

But I don’t use them in production on

In particular, I use “log_buddy” and have lots of d {var} statements throughout.

And I use pry which has a require pry and require-debug statement.

These statements create errors in the case of pry and duplicate logging in the case of log_buddy when the code runs in production.

How do I make a distinction between the two environments?

I have read about dotenv and some other gem, but didn’t quite understand how it would work in my scenario.

Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.