LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > LSAPI do something wrong with ENV

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2009, 07:29 AM
Grzegorz Derebecki Grzegorz Derebecki is offline
Senior Member
 
Join Date: Jun 2007
Posts: 92
Default LSAPI do something wrong with ENV

Grrrrr... i spend all my day to fix this bug:

when we require lsapi gem the ENV var will be lost! In RailsRunner (for 2.3)
we have:

Code:
server = Rack::Handler::LSWS
this is rack/lib/rack/handler/lsws.rb and in line 1 we have:

Code:
require 'lsapi'
after this require ENV varible will be empty.

Some rails plugins use ENV['RAILS_ENV'] or other ENV varibles exemple: Thinking Sphinx is initialized early and use ENV['RAILS_ENV'] if it is not set it use 'devalopment' mode even if i'm on production.

Ok how to fix it? I don't like C.. then i fixed it in RailsRunner:

Code:
env = ENV
server = Rack::Handler::LSWS
env.each { |k,v| ENV[k] ||= v }
i used this syntax becous if in future it start works correctly it want broken anything
Reply With Quote
  #2  
Old 11-09-2009, 11:49 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Thanks for the bug report and fix. We will take a look at this issue.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:59 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.