#83 ✓resolved
Curtis Summers

set RACK_ENV based on environment option

Reported by Curtis Summers | October 1st, 2008 @ 10:34 PM | in 1.1

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?

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Attachments

Tags

Referenced by

Pages