title: No such file or directory when making system calls in Rails production env
body: <p>I'm getting some annoying errors when trying to make system calls in the rails console in a production environment.</p>
  
  <pre><code>Loading production environment (Rails 4.0.2)
  2.0.0 :001 &gt; `hostname`
  bin/rails: No such file or directory - hostname
   =&gt; nil
  </code></pre>
  
  <p>It works fine in <code>irb</code>.</p>
  
  <pre><code>$ irb
  2.0.0-p353 :001 &gt; `hostname`
  =&gt; "app-1\n"
  </code></pre>
  
  <p>Same thing happens on my local machine. <code>rails c</code> is fine but <code>rails c production</code> gives the error above.</p>
  
  <p><code>ruby -v</code> outputs <code>ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]</code></p>
  
  <p><code>rails --version</code> outputs <code>Rails 4.0.2</code></p>
  
  <p>I'm not really sure where to start debugging this so any advice is welcome! I have tried running <code>rake rails:update:bin</code>, based on <a href="https://stackoverflow.com/questions/17583439/bin-rails-no-such-file-or-directory-w-ruby-2-rails-4-on-heroku">&quot;bin/rails: No such file or directory&quot; w/ Ruby 2 &amp; Rails 4 on Heroku</a>, but it didn't seem to make a difference. Any ideas?</p>