In my Roda app I have this:
# Gemfile
puts "env is: " + ENV["RACK_ENV"]
if ENV["RACK_ENV"] == "development"
puts "env dev"
gem "gem1"
end
This isn't working: the "puts" aren't executed, and the gem "gem1" isn't included either. The "env" is development, I've checked that when a page is loading.
Why not and how to fix it?
If what you need is to set gems based on their environment, you use groups in the Gemfile.
You can do some thing like this...
Coming back to your question...
I assume you haven't set the
RACK_ENVvariable. I don't develop Roda but I think it is just assuming it is 'development'. So if you want to useRACK_ENVvariable in your code, you will need to set it explicitly.You can do an
export RACK_ENV=developmentto set the env explicitly.