ENV['RAILS_ENV'] returns nil when called inside Rails 2.3.4 initializer

thbar

Active Member
#1
Hello,

if I use an initializer under config/initializer/myfile.rb, it seems that when the code is called, ENV['RAILS_ENV'] is empty when I use LiteSpeed, whereas it has a value of development or production if I use ruby script/server.

Is it a known issue ?

My work-around has been to hard-code to production for the moment.

thanks,

-- Thibaut
 

thbar

Active Member
#3
I've been reading a lot but I'm not sure what's the right way to do things.

I have a virtual host, but it doesn't have anything in the "external app" tab. Should I add a lsapi external app ?

I'm a bit confused about dispatch.lsapi vs RailsRunner etc - what is the recommended way to run a Rails 2.3.4 app ?

thanks,

-- Thibaut
 

thbar

Active Member
#7
Hey Grzegorz,

thanks for the links - I will give these a go next time I deploy to this site (coming weeks).

Thanks!

-- Thibaut
 
#8
I used to work with rails 2.3.2 before and then
I decided to upgrade to version 2.3.4. " ERRORS ARE STILL THERE "
I don't know why this is happening. Everything worked
fine in 2.3.2 and now it doesn't. :confused::confused:
 
Top