Unicorn service upstart script throws “-su: bundle: command not found”

余生颓废 提交于 2019-12-04 14:46:52

I found out the issue. Explanation follows,

root user on startup will first su - into the rails user (in this case 'joe') then executes bundle to start up unicorn. rbenv is single user, only 'joe' has bundle installed. The path to bundle is likely stored in my .bashrc file. However .bashrc file which is not invoked by login in through su - and that caused the bundle not installed error.

I included the paths related to rbenv in .profile. This way when root su - into 'joe' the paths are loaded.

Fabio Campinho

On Unbutu I created I file /etc/profile.d/rbenv.sh with this content:

export RBENV_ROOT=/home/YOUR_USER_PATH/.rbenv
export PATH=$RBENV_ROOT/shims:$RBENV_ROOT/bin:$PATH
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!