title: env: bash: No such file or directory
body: <p>(Yes I have checked other answers, and this has nothing to do with line endings.)</p>
  
  <p>I am getting the following subprocess error deploying <code>Passenger</code> on <code>nginx</code>.  This is on <code>FreeBSD-11.1</code>:</p>
  
  <pre><code>env: bash: No such file or directory
  </code></pre>
  
  <p>Very strange.  The <code>nginx</code> process starts up as <code>root</code>, then moves to <code>nobody</code>, whose shell I have indeed changed to <code>/usr/local/bin/bash</code>.  How either of these users can't see <code>bash</code> is strange.  But their reported paths don't include <code>/usr/local/bin</code>:</p>
  
  <p>The <code>root</code> environment:</p>
  
  <pre><code>uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
  
  SERVER_SOFTWARE=nginx/1.14.0 Phusion_Passenger/5.3.4
  PASSENGER_USE_FEEDBACK_FD=true
  PATH=/sbin:/bin:/usr/sbin:/usr/bin
  PWD=/
  HOME=/
  RC_PID=1360
  </code></pre>
  
  <p>And for <code>nobody</code>:</p>
  
  <pre><code>uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
  
  PYTHONUNBUFFERED=1
  PASSENGER_SPAWN_WORK_DIR=/tmp/passenger.spawn.lJk10nqveb
  RC_PID=1360
  PASSENGER_USE_FEEDBACK_FD=true
  NODE_PATH=/usr/local/lib/ruby/gems/2.5/gems/passenger/src/nodejs_supportlib
  NODE_ENV=production
  USER=nobody
  PWD=/usr/local/www/pneb
  HOME=/nonexistent
  PASSENGER_APP_ENV=production
  RAILS_ENV=production
  SHELL=/usr/local/bin/bash
  RACK_ENV=production
  SHLVL=0
  IN_PASSENGER=1
  WSGI_ENV=production
  LOGNAME=nobody
  PATH=/sbin:/bin:/usr/sbin:/usr/bin
  SERVER_SOFTWARE=nginx/1.14.0 Phusion_Passenger/5.3.4
  </code></pre>
  
  <p>Neither of these users can see bash.  I'm not sure which is throwing the error.  </p>
  
  <p>How can I get past this issue?  I expect <code>Passenger</code> working with <code>nginx</code> to be able to see shells.  </p>