I am having problems with these commands:
rails generate
rails destroy
rails console
rake
I need to run long operations, only if an application is started via rails server
.
Rails.env.production?
is not an option.
I am having problems with these commands:
rails generate
rails destroy
rails console
rake
I need to run long operations, only if an application is started via rails server
.
Rails.env.production?
is not an option.
If you are using the environments how you should be, then you'd limit your actions where you want to use this condition to the development or staging environments, regardless if you use rails server or not, right?
Most sites never use rails server
in production and it sounds like you don't want it for your testing environment... so why not just use if Rails.env.development?
(and staging if you have one).