ruby on rails - -su: bundle: command not found when starting unicorn -
i'm following tutorial @ digitalocean (fyi, tutorials, link1 , link2 ), install production ready rails app using unicorn, , nginx, , when part on installing unicorn. when try typing console:
sudo service unicorn_appname start
i error:
starting appname -su: bundle: command not found
all users can bundle. message makes no sense me. ideas?
i followed same guide , had same issue.
the startup script in init.d/unicorn_appname evaluated to:
su - deploy -c cd /home/deploy/appname && bundle exec unicorn -c config/unicorn.rb -e production -d
root user on startup first su - rails user (in case 'deploy') excutes bundle start unicorn. rbenv single user, 'deploy' has bundle installed. path bundle stored in .bashrc file if followed guide. .bashrc file not invoked login in through su - , caused bundle not installed error.
the solution include paths related rbenv in .profile. way when root su - 'deploy' paths loaded.