Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to set GEM_HOME and GET_PATH when nginx starts, is the /etc/init.d/nginx script an ideal place for this, specifically the function start() ?

Do I just add: export GEM_HOME=/path/to/home/... export GEM_PATH=/path/to/gempath/....

Does this seem ok?

(i'm running nginx that was installed by phusion, rails3, rvm on ubuntu)

share|improve this question

Nginx talks with ruby through passenger or HTTP, it does not integrate ruby into its process Apache does so while you can set an environment variable that variable will only be available to Nginx, not Ruby.

What you should do is go read the passenger documentation as it adds directives to the Nginx configuration where you can set these things.

share|improve this answer
Is this it?… – Blankman Dec 5 '10 at 15:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.