I'm following a tutorial at DigitalOcean (fyi, this is the tutorials, link1 , link2 ), to install a production ready rails app using unicorn, and nginx, and when I get to the part on installing unicorn. When I try typing this into the console:
sudo service unicorn_appname start
I get this error:
Starting appname
-su: bundle: command not found
All users can bundle. This message makes no sense to me. Any ideas?
I also followed the same guide and had the same issue.
The startup script in init.d/unicorn_appname is evaluated to:
su - deploy -c cd /home/deploy/appname && bundle exec unicorn -c config/unicorn.rb -E production -D
root user on startup will first su - into the rails user (in this case 'deploy') then excutes bundle to start up unicorn. rbenv is single user, only 'deploy' has bundle installed. The path to bundle is likely stored in your .bashrc file if you followed the guide. However .bashrc file which is not invoked by login in through su - and that caused the bundle not installed error.
The solution would be to include the paths related to rbenv in .profile. This way when root su - into 'deploy' the paths are loaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With