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)
- SecurityUpdateCheck fails when using builtin engine HOT 1
- Lacking rubyext-ruby-3.2.2-x86_64-linux.tar.gz from Release 6.0.20. HOT 1
- no Phusion Passenger(R) log file configured, discarding log output HOT 12
- Unable to locate package libnginx-mod-http-passenger | bullseye HOT 1
- Unable the fetch the repo for mod_passenger HOT 12
- passenger v6.0.21, ruby 3.3.1 with apache crashing. HOT 11
- passenger 6.0.21 will not install on AlmaLinux 9 / RHEL 9 HOT 8
- Unable to Install Passenger HOT 8
- Restore support for MacOS < 10.15 HOT 1
- Estimated Release date of Ubuntu 24.04 APT repository? HOT 12
- Passenger Enterprise zero-downtime restarts & request routing can prolong outages and delay recovery HOT 1
- Downtime https://oss-binaries.phusionpassenger.com HOT 3
- Connection is not closed in response to unrecognized `Transfer-Encoding` values when `Host` header is missing
- https://oss-binaries.phusionpassenger.com is down HOT 2
- TmpIO doesn't respect PassengerDataBufferDir
- Dependency strscan breaks passenger-status command HOT 1
- Passenger Status Metrics Endpoint
- New Apt Origin/Label HOT 5
- rackup version missing in gemspec HOT 4
- apt-get update fails for Jammy due to repository 'Origin' and 'Label' changes HOT 2
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.