iwan
iwan

Reputation: 7569

ruby script/server not reading RAILS_ENV option

I tried to run

ruby script/server RAILS_ENV=production

but somehow it always try to read "development" config.. nothings wrong with RAKE XXX RAILS_ENV=production (trying to read production config).

Any idea how to troubleshoot?

I have my other rails app in the same machine and it works fine. The problem above only happen for redmine rails.

Thanks in advance. -iwan

Upvotes: 1

Views: 2748

Answers (2)

Michael F
Michael F

Reputation: 321

The problem with the first command was that the environment needs to be set prior to invoking the server, so: RAILS_ENV="production" script/server

(although, as noted, appending "-e production" afterwards does the same thing)

Upvotes: 3

vise
vise

Reputation: 13393

script/server doesn't use RAILS_ENV.

Try ruby script/server -e production

Upvotes: 7

Related Questions