title: custom env vars with rvmsudo
body: <p>I am trying to run a ruby script which needs root access for some of its tasks. I know that rvmsudo exists and I use it, but if I want to set up an env var such as <code>TEST_ENV=1</code>, it doesn't work.</p>
  
  <p>Example:</p>
  
  <pre><code>rvmsudo ruby some_script_which_requires_root_access.rb
  </code></pre>
  
  <p>When I debug the script and examine the <code>ENV</code> hash, I don't see the <code>TEST_ENV=1</code> var. I have tried exporting the var via:</p>
  
  <pre><code>export TEST_ENV=1 
  </code></pre>
  
  <p>and put this in <code>.rvmrc</code>, in <code>.bash_profile</code> and <code>.bashrc</code> for the <code>current_user</code>, and also in <code>.profile</code> and <code>.bashrc</code> of the root user but doesn't work. </p>
  
  <p>So my question is, where should I define or export this <code>TEST_ENV=1</code> so that when I run the script with <code>rvmsudo</code> it is part of the <code>ENV</code> ruby hash?</p>