George Morris
George Morris

Reputation: 484

Ruby on Rails + Passenger, ENV not changing

First of all, our project structure is a bit different than a regular ruby on rails project therefore we don't have anything like environment.rb.

I am running into an issue changing the ENV variables. The server keeps starting under development mode.

Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)
development

I tried changing those variables like this export RAILS_ENV=production and restarting the server using service httpd restart but for some reason none of these variables will change.

My question is, where can I possibly find/override those variables in a file?

Upvotes: 0

Views: 855

Answers (3)

Shuaib Zahda
Shuaib Zahda

Reputation: 214

In Rails 5, these lines are moved from .htaccess to apache configuration file.

RackBaseURI /
PassengerAppRoot /path/to/public_html
RailsEnv production

I am running on apache 2.4.18, Phusion Passenger 5.2.1.

Upvotes: 0

George Morris
George Morris

Reputation: 484

Found it. It was under my httpd.conf where I just changed variable RailsEnv to production

Upvotes: 1

Prawl
Prawl

Reputation: 21

Try setting the environment variables in the /etc/environment file on your server. I had a similar issue recently and that seemed to resolve it for me. It would look something like FOO=bar

Upvotes: 1

Related Questions