sosedoff / capistrano-unicorn

Capistrano integration for Unicorn! - NEEDS MAINTAINER
MIT License
401 stars 141 forks source link

sudo: bundle: command not found, Compatible with RVM? #59

Open climatecheck opened 11 years ago

climatecheck commented 11 years ago

I'm trying to get RVM, capistrano and unicorn to place nice together with a multistage setup. I'm currently getting this:

joshua@ccubuntu:~/collaborase/current$ cap unicorn:start
triggering load callbacks
* 2013-07-15 19:56:06 executing `staging'
triggering start callbacks for `unicorn:start'
* 2013-07-15 19:56:07 executing `multistage:ensure'
* 2013-07-15 19:56:07 executing `unicorn:start'
  triggering before callbacks for `unicorn:start'
* executing "if [ -e /home/staging/capistrano/current/config/unicorn.rb ]; then\\\n              UNICORN_CONFIG_PATH=/home/staging/capistrano/current/config/unicorn.rb;\\\n            else\\\n              if [ -e /home/staging/capistrano/current/config/unicorn/staging.rb ]; then\\\n                UNICORN_CONFIG_PATH=/home/staging/capistrano/current/config/unicorn/staging.rb;\\\n              else\\\n                echo \"Config file for \"staging\" environment was not found at either \"/home/staging/capistrano/current/config/unicorn.rb\" or \"/home/staging/capistrano/current/config/unicorn/staging.rb\"\";\\\n                exit 1;\\\n              fi;\\\n            fi;\\\n\\\n            if [ -e /home/staging/capistrano/current/tmp/pids/unicorn.pid ]; then\\\n              if sudo -p 'sudo password: ' -u staging kill -0 `cat /home/staging/capistrano/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then\\\n                echo \"Unicorn is already running!\";\\\n                exit 0;\\\n              fi;\\\n\\\n              sudo -p 'sudo password: ' -u staging rm /home/staging/capistrano/current/tmp/pids/unicorn.pid;\\\n            fi;\\\n\\\n            echo \"Starting Unicorn...\";\\\n            cd /home/staging/capistrano/current && sudo -p 'sudo password: ' -u staging BUNDLE_GEMFILE=/home/staging/capistrano/current/Gemfile bundle exec unicorn -c $UNICORN_CONFIG_PATH -E staging -D;"
servers: ["ccdev.dyndns.org"]
Password:
[ccdev.dyndns.org] executing command
 ** [out :: ccdev.dyndns.org] Starting Unicorn...
 ** [out :: ccdev.dyndns.org] sudo: bundle: command not found
    command finished in 785ms
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'default' -c 'if [ -e /home/staging/capistrano/current/config/unicorn.rb ]; then\\\n              UNICORN_CONFIG_PATH=/home/staging/capistrano/current/config/unicorn.rb;\\\n            else\\\n              if [ -e /home/staging/capistrano/current/config/unicorn/staging.rb ]; then\\\n                UNICORN_CONFIG_PATH=/home/staging/capistrano/current/config/unicorn/staging.rb;\\\n              else\\\n                echo \"Config file for \"staging\" environment was not found at either \"/home/staging/capistrano/current/config/unicorn.rb\" or \"/home/staging/capistrano/current/config/unicorn/staging.rb\"\";\\\n                exit 1;\\\n              fi;\\\n            fi;\\\n\\\n            if [ -e /home/staging/capistrano/current/tmp/pids/unicorn.pid ]; then\\\n              if sudo -p '\\''sudo password: '\\'' -u staging kill -0 `cat /home/staging/capistrano/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then\\\n                echo \"Unicorn is already running!\";\\\n                exit 0;\\\n              fi;\\\n\\\n              sudo -p '\\''sudo password: '\\'' -u staging rm /home/staging/capistrano/current/tmp/pids/unicorn.pid;\\\n            fi;\\\n\\\n            echo \"Starting Unicorn...\";\\\n            cd /home/staging/capistrano/current && sudo -p '\\''sudo password: '\\'' -u staging BUNDLE_GEMFILE=/home/staging/capistrano/current/Gemfile bundle exec unicorn -c $UNICORN_CONFIG_PATH -E staging -D;'" on ccdev.dyndns.org

I'm trying not to use sudo or rvmsudo. I've set unicorn_user = 'staging' in unicorn.rb. That's the same user as :user in deploy.rb but I was getting a can't find user for apps error till I inserted that.

Ideas?

michelson commented 11 years ago

I get the same errors, I´ve downgraded to 0.7.1 and it works

sfsekaran commented 11 years ago

If you would write a failing spec for this, and maybe a fix too, that would be awesome. I know RVM issues can be tough, so any help is very much appreciated!

Sathya Sekaran Sent from Mailbox for iPhone

On Tue, Sep 10, 2013 at 7:24 PM, Miguel Michelson Martinez notifications@github.com wrote:

I get the same errors, I´ve downgraded to 0.7.1 and it works

Reply to this email directly or view it on GitHub: https://github.com/sosedoff/capistrano-unicorn/issues/59#issuecomment-24209010