rackup and environment

162 views
Skip to first unread message

candlerb

unread,
Mar 5, 2009, 9:24:57 AM3/5/09
to Rack Development
A couple of comments about rackup.

(1) If you type "rackup -E production", then everything looks OK until
the first request comes in, at which point you get a strange error
about nil not responding to #call.

It turns out this is because rackup only understands "development",
"deployment" and "none", and any other setting silently leaves the app
set to nil. IMO it would be friendlier if rackup either treated all
unknown values as "deployment", or else refused to run and gave an
error message.

(2) I read that thin and phusion set a RACK_ENV environment variable
when loading a .ru file. However the source for Rack doesn't seem to
use it at all! Is this something intended for the end application to
use, rather than Rack itself?

If it is common practice for .ru files to be treated this way, do you
think rackup itself should set RACK_ENV? From the -E option? (In which
case people are going to want to use -E production, -E test etc). It's
not necessary of course - they can do RACK_ENV=foo rackup ...

Regards,

Brian.
Reply all
Reply to author
Forward
0 new messages