Jigar Gosar
2007-Nov-14 19:28 UTC
Webrick: does it honour ENV[''RAILS_ENV''] ||= ''production''
my environment.rb contains ENV[''RAILS_ENV''] ||= ''production'' when i start webrick with command ruby script\server it still runs in development mode. Is this expected behavior of webrick?? why? the only way to run webrick in peoduction mode,it seems, is by :- ruby script\server -e production -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeremy McAnally
2007-Nov-14 19:48 UTC
Re: Webrick: does it honour ENV[''RAILS_ENV''] ||= ''production''
The ||= operator indicates that if RAILS_ENV isn''t already set, then Ruby should set it (in this case, to ''production''). I''m willing to bet that WEBrick sets it to development before it gets to that line environment.rb. Try changing ||= to = (I don''t know if that will work). --Jeremy On 11/14/07, Jigar Gosar <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > my environment.rb contains > ENV[''RAILS_ENV''] ||= ''production'' > > when i start webrick with command > ruby script\server > > it still runs in development mode. Is this expected behavior of > webrick?? why? > > the only way to run webrick in peoduction mode,it seems, is by :- > ruby script\server -e production > -- > Posted via http://www.ruby-forum.com/. > > > >-- http://www.jeremymcanally.com/ My books: Ruby in Practice http://www.manning.com/mcanally/ My free Ruby e-book http://www.humblelittlerubybook.com/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jigar Gosar
2007-Nov-14 20:03 UTC
Re: Webrick: does it honour ENV[''RAILS_ENV''] ||= ''production
thanks for reply, it was thoughtful But alas, ENV[''RAILS_ENV''] = ''production'' doesn''t work either. I think I''ll stick to -e production Jeremy McAnally wrote:> The ||= operator indicates that if RAILS_ENV isn''t already set, then > Ruby should set it (in this case, to ''production''). I''m willing to > bet that WEBrick sets it to development before it gets to that line > environment.rb. Try changing ||= to = (I don''t know if that will > work). > > --Jeremy > > On 11/14/07, Jigar Gosar <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> the only way to run webrick in peoduction mode,it seems, is by :- >> ruby script\server -e production >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > http://www.jeremymcanally.com/ > > My books: > Ruby in Practice > http://www.manning.com/mcanally/ > > My free Ruby e-book > http://www.humblelittlerubybook.com/ > > My blogs: > http://www.mrneighborly.com/ > http://www.rubyinpractice.com/-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---