I've been everywhere today looking for the way to properly set my RAILS_ENV for Passenger. I want to use the test environment now that the site is on my server, but I don't want it to be production because I'm having database issues.
I've been directed to this part of the documentation, but it didn't make any sense to me. I had PassengerAppEnv RAILS_ENV = 'test'
in my Apache .conf file for the site and -- as expected -- that didn't' work.
I've also set RAILS_ENV = 'test'
in config/environment.rb
of my Rails site, but that didn't work either.
Thanks!
You're close, but not quite correct. Here is how you set it:
<Directory /path/to/app/public>
Allow from all
Options -Multiviews
# ^ for Apache 2.4+
Require all granted
RailsEnv development # < place desired environment here
</Directory>
Basically Passenger will see the line in the configuration file and then set it for you. It uses the more Apache style syntax of:
Name [space] <value>
So you don't need all the quotes or any Ruby style syntax at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With