Using $ sudo bundle exec … raises 'bundle: command not found' error

前端 未结 4 700
粉色の甜心
粉色の甜心 2020-12-11 09:16

I have installed rbenv on an Ubuntu sever. I can cd into my application directory and run $ bundle without issue, however I need to run $ sudo bundle exec

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 09:39

    Not entirely sure, but maybe this would work for you:

    sudo -i -u $USER bundle exec... 
    

    or

    sudo -i -u username_with_correct_env bundle exec... 
    

提交回复
热议问题