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:
this is rack/lib/rack/handler/lsws.rb and in line 1 we have:
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:
i used this syntax becous if in future it start works correctly it want broken anything ![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
when we require lsapi gem the ENV var will be lost! In RailsRunner (for 2.3)
we have:
Code:
server = Rack::Handler::LSWS
Code:
require 'lsapi'
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 }