title: Capistrano passenger-config restart-app command not found
body: <p>I have run into an issue restarting my Rails application during the deployment process using Capistrano. Here is a trace of the problem code:</p>
  
  <pre><code>INFO [e14478ef] Running /usr/bin/env rvmsudo passenger-config restart-app /var/www/appname/staging/ --ignore-app-not-running as deploy@xxx.xxx.xxx.xx
  DEBUG [e14478ef] Command: rvmsudo passenger-config restart-app
  DEBUG [e14478ef]        bash: rvmsudo: command not found
  </code></pre>
  
  <p>I am almost certain this issue is stemming from the environment from which the command is being executed ($BASH_ENV), but I'm not sure how to remedy the issue. When I execute the same command manually from the command line, everything works fine. My app is using:</p>
  
  <ul>
  <li>Ruby (2.2.0)</li>
  <li>Rails (4.2.0)</li>
  <li>Capistrano (3.4.0)</li>
  <li>Capistrano-passenger (0.0.4)</li>
  <li>Capistrano-rails (1.1.2)</li>
  <li>Capistrano-rvm (0.1.2)</li>
  <li>Passenger (5.0.6)</li>
  </ul>
  
  <p><strong>Just a note:</strong> I have been able to restart the app by overwriting the passenger:restart task and using the old touch tmp/restart.txt method. However, I would really like to know how to get the default restart method working correctly.</p>
  
  <p><strong>Update:</strong> I was able to circumvent the problem by replacing the default restart task with the following code:</p>
  
  <pre><code>desc 'Restart your Passenger application - temporary fix'  
  task :restart do  
    on roles(:app) do  
      sudo "passenger-config restart-app #{fetch(:deploy_to)}"  
    end  
  end
  </code></pre>
  
  <p>I am still interested in learning how to restart the app without overwriting the default task, but I have added the code above for those who may be stuck in a similar situation.</p>
  
  <p>(Credit: <a href="https://github.com/capistrano/passenger/issues/9#issuecomment-92685064" rel="nofollow">https://github.com/capistrano/passenger/issues/9#issuecomment-92685064</a>)</p>