Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
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)
- mod_passenger dependency issues HOT 1
- Feature Request - Log crashes to stderr instead of files HOT 2
- Fails to recognise Nestjs app start HOT 2
- Uninitialized constant Rackup::Handler::Rack (NameError) [Rack 3] HOT 4
- Error loading libssl.so.1.1 when starting Phusion Passenger Standalone HOT 1
- Bad Signing Key for Debian Bullseye HOT 3
- Restarting doesn't remove deleted environment variables in rbenv-vars HOT 1
- Hooks not being registered HOT 4
- String conversion while handling native Ruby support lib LoadErrors can cause errors HOT 1
- Feature request: Ability to configure path to error renderer template
- Deprecation warning with ActiveRecord 7.1.2
- passenger-install-nginx-module is running after installation as a dynamic module HOT 8
- Security update without published advisory HOT 2
- Memory leak HOT 3
- Crash when starting Ruby 3.3.0 Rails 7 application HOT 3
- Disable secure headers option for GLS HOT 1
- HTTP3/QUIC breaks passenger Python apps ( Nginx + HTTP3 + Passenger ) HOT 2
- Cannot build passenger nginx dynamic module HOT 1
- Out of memory leads to passenger shutdown and ensuing 502 error on nginx HOT 3
- Out of memory leads to passenger shutdown and ensuing 502 error on nginx HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passenger.