Git Product home page Git Product logo

Comments (9)

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From honglilai on May 01, 2008 09:52:03

Could you give the following information?

  • Do you have a ENV['RAILS_ENV'] assignment line in your environment.rb? If so, how
    does it look like?
  • What value is your RailsEnv Apache option set to?

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From fannar on May 01, 2008 11:50:28

Nope. No ENV['RAILS_ENV'] in environment.rb. Just used to using Mongrel and then I get my ENV['RAILS_ENV'] set
to production. Also tried to set ENV['RAILS_ENV'] = 'production' in production.rb without luck.

I haven't set RailsEnv option in Apache because I thought Passenger would set RailsEnv production as default ?

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From honglilai on May 01, 2008 12:01:58

Yes, it would set it to 'production' as default. The RAILS_ENV constant is the
authoritative way to figure out the Rails environment.

Not sure why ENV['RAILS_ENV'] isn't set correctly, but as long as RAILS_ENV is
correct then everything is OK.

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From fannar on May 01, 2008 12:08:00

Yes thats true. I'm using the RAILS_ENV constant normally. Just some old code used the ENV['RAILS_ENV']. You at
least look into this when there is time ;)

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From melvinrram on May 30, 2008 12:15:22

I have the same problem. My apps seem to default to development mode. Any fix for this?

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From honglilai on June 11, 2008 01:41:29

I can't reproduce this at all. Can anyone post specific instructions for reproducing
this problem?

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From spswerling on August 01, 2008 11:58:59

I had the same problem if I tried to run 2 different RAILS_ENVs from the same code
directory
. The rails_env sticks to the directory rather than to the vhost.

Lets say you have

<VirtualHost *:3000>
DocumentRoot /path/to/my/app/public
RailsEnv development

<VirtualHost *:4000>
DocumentRoot /path/to/my/app/public
RailsEnv production

With the config above, if you hit 3000 first thing after restarting apache, then from
then on both port 3000 and 4000 will use rails_env=development. Conversely, if you
hit 4000 first, both vhosts will use 'production'.

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From honglilai on August 01, 2008 12:20:19

That's the way it's intended to work. Passenger identifies applications based on the
document root, not the host name. So if you've accessed http://localhost:3000/ then
Passenger will spawn a new Rails process with RAILS_ENV == "development". If you
access http://localhost:4000/ next, then Passenger will reuse the Rails process that
it spawned last time instead of spawning a new one, because it thinks it's the same
application.

To solve this you need to point different virtual hosts to different document roots.

Status: WontFix

from passenger.

FooBarWidget avatar FooBarWidget commented on June 5, 2024

From dominik.krebs on July 17, 2010 04:22:05

Please document the described behavior for others at http://modrails.org/documentation/Users%20guide%20Apache.html#rails_env I've been searching for more than one hour cause of that behavior and didn't find anything.
If you can set a configuration option and it has no effect, this should be documented for everyone.

To solve the problem you just have to symlink your application to another directory.

Thanks!

from passenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.