a-chernykh / railsbox

Fast and easy Ruby on Rails virtual machines
https://railsbox.io
MIT License
320 stars 52 forks source link

Executing bundler as root instead of the new created user. #42

Closed armoucar closed 8 years ago

armoucar commented 8 years ago

Hello guys, I'm having an error when executing the provision.sh script. More specifically, the error is in the deploy task, when trying to install the gems with Bundler.

TASK: [deploy | Install gems] ************************************************* 
failed: [162.243.231.216] => {"changed": true, "cmd": ["/bin/bash", "-lc", "bundle install --deployment --without=\"development test\""], "delta": "0:00:00.008151", "end": "2016-02-16 08:06:40.824821", "rc": 127, "start": "2016-02-16 08:06:40.816670", "warnings": []}
stderr: /bin/bash: bundle: command not found

I checked my server and saw that a new user is created with the name of my app and the rbenv is installed under this user. What I think that is happening is simple: the command above it's being execute as root who doesn't have rbenv installed.

I tried to find a way of executing '/bin/bash -lc' as another user but couldn't find it. Does someone know? Thank you!