title: Where is SECRET_KEY_BASE environment variable located when I start Rails app in Production
body: <p>In the <a href="https://www.manning.com/books/rails-4-in-action" rel="nofollow noreferrer">Rails 4 In Action Book</a>, it states that after doing some other setup: the final setup to boot up your rails app in production mode (with web brick) is to enter this command in terminal:</p>
  
  <pre><code>SECRET_KEY_BASE='rake secret' rails s -e production
  </code></pre>
  
  <p>I am trying to see where the environment variable of <code>SECRET_KEY_BASE</code> is stored.  </p>
  
  <p>Within <code>/app/config/secrets.yml</code> it says that the <code>secret_key_base</code> variable is an environment variable:</p>
  
  <pre><code>production:
    secret_key_base: &lt;%= ENV["SECRET_KEY_BASE"] %&gt;
  </code></pre>
  
  <p>But I looked within <code>.bashrc</code> and <code>.bash_profile</code> and the variable <code>SECRET_KEY_BASE</code> is not there.</p>
  
  <p>Ultimately I want to know: where is environment variable and its value?  Is it stored somewhere in my rails app?  I hope not for security purposes if I push this app to github.  I assume it is not stored in the app but in my computer system somewhere.  Within a different terminal window I do <code>echo $SECRET_KEY_BASE</code> but nothing gets returned.  </p>
  
  <p>Thanks in advance for helping me understand the missing pieces. </p>
  
  <p>As a side note: I am aware of <a href="https://stackoverflow.com/questions/24792714/where-is-envsecret-key-base-being-set-in-production-rails">this question</a>, but the question is not as detailed and there is no provided answer.  </p>