Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

set RACK_ENV based on environment option

#83

This is a request and a preliminary patch to set the RACK_ENV environment variable based on the environment option.

I'll admit I'm not very familiar with thin's code base yet, so if there's a better place to set this than what is offered in my patch, please fix.

For the background on this issue, the following is from an email I sent to macournoyer:

I'm using the rackup option in thin's config file, and then my rack config looks like this for a Sinatra app:

require 'rubygems'
require 'sinatra'

Sinatra::Application.default_options.merge!(
:run => false, :env => ENV['RACK_ENV'] )

require 'app/application.rb'
run Sinatra.application

As suggested, I have to set the RACK_ENV variable upon startup or have it already in the environment. This is problematic for multiple configs with different environments when using the init script. I would prefer to have thin read the environment in the config and make it available to my application.

For Rack applications, would it be appropriate to have thin setup the RACK_ENV environment variable based on the environment option in thin's config file or the one passed on the command line?

Reported by Curtis Summers · October 1st, 2008 @ 10:34 PM

State: resolved
Milestone: 1.1
Assigned to: macournoyer macournoyer

Activity

  1. macournoyer
    macournoyer
    • State changed from new to resolved

    (from [1e90d63f9139f6bc5dc7624ef07076bedcbb0bb3]) Set RACK_ENV based on environment option when loading rackup file [Curtis Summers] [#83 set RACK_ENV based on environment option state:resolved] http://github.com/macournoyer/th...

    October 21st, 2008 @ 11:27 PM

  2. macournoyer
    macournoyer
    • Milestone changed from Future to 1.1

    Thx for the patch Curtis!

    October 21st, 2008 @ 11:30 PM

  3. macournoyer
    macournoyer

    (from [20a46fbc6da8bd603e1e99ee760392abdbafc067]) Merge branch 'master' into async_for_rack

    March 16th, 2009 @ 09:45 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.