Brian Lin
2006-Feb-10 19:07 UTC
[Rails] Setting RAILS_ENV before running script/server in the comma
I want to set an environment variable before running a script for example setting ENV[''RAILS_ENV''] = production in the command line before running script/server so that it would start in production mode. Is there a way to do this from the command line so that I don''t have to modify the file? Thanks, Brian -- www.kenlet.com
Francois Beausoleil
2006-Feb-10 19:14 UTC
[Rails] Setting RAILS_ENV before running script/server in the comma
Hi ! 2006/2/10, Brian Lin <brianlin@gmail.com>:> ENV[''RAILS_ENV''] = productionIf that is all you want to do, script/server has an option to do just that: script/server -e production On the other hand, if you want to set other environment variables, you might want to create a launcher script: #!/bin/sh export SOME_VAR=123 export VAR2=/var/db/root cd /var/www/app1 script/server -e production If you''re on Windows, the same can be done, albeit slightly differently. Hope that helps ! -- Fran?ois Beausoleil http://blog.teksol.info/