title: God using sudo fails to find the environment parameter SECRET_KEY_BASE in the .bash_profile file
body: <p>I added those rows to <code>/home/web/.bash_profile</code>. The web is the user of Rails app.</p>
  
  <pre><code>SECRET_KEY_BASE=xxxxxxxxxxxxxxxxxxxxx
  export SECRET_KEY_BASE
  </code></pre>
  
  <p>I added this row into <code>/etc/sudoers</code>.</p>
  
  <pre><code>Defaults env_keep += "SECRET_KEY_BASE"
  </code></pre>
  
  <p>This command returns expected result.</p>
  
  <pre><code>sudo ruby -e 'puts ENV["SECRET_KEY_BASE"]'
  </code></pre>
  
  <p>If I run Unicorn without God, it can find SECRET_KEY_BASE from environment, and performs normally.</p>
  
  <pre><code>bundle exec unicorn_rails -c config/unicorn.rb -E production -D
  </code></pre>
  
  <p>Running Unicorn using sudo without God performs normally, too.</p>
  
  <pre><code>sudo bundle exec unicorn_rails -c config/unicorn.rb -E production -D
  </code></pre>
  
  <p>But when I run Unicorn with God using sudo, it failed to find SECRET_KEY_BASE and becomes error.</p>
  
  <pre><code>sudo god start my_app
  </code></pre>
  
  <p>The start command in the my_app.god is this.</p>
  
  <pre><code>God.watch do |w|
    w.start = "cd #{rails_root} &amp;&amp; bundle exec unicorn_rails -c config/unicorn.rb -E #{rails_env} -D"
    w.uid = 'web'
    w.gid = 'web'
  ...
  end
  </code></pre>
  
  <p>It seems that the problem exists around God rather than .bash_profile and Unicorn. Besides what should I try?</p>