RACK_ENV environment variable.
development
development environment all templates are
reloaded between requests, and special not_found and
error handlers
display stack traces in your browser
production and test environments, templates are cached by default
RACK_ENV environment variable:
RACK_ENV=production ruby my_app.rb
development?, test?
and production? to check the current environment setting:
get '/' do
if settings.development?
"development!"
else
"not development!"
end
end
Casiano Rodriguez León 2015-01-07