Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Cannot execute bundle #100

Open
petrjanda opened this issue Feb 8, 2014 · 7 comments
Open

Cannot execute bundle #100

petrjanda opened this issue Feb 8, 2014 · 7 comments

Comments

@petrjanda
Copy link

I've just started new server to test recap. Ran into this issue:

cap deploy:setup
  * 2014-02-08 13:47:32 executing `deploy:setup'
    triggering before callbacks for `deploy:setup'
  * 2014-02-08 13:47:32 executing `preflight:check'
  * executing "id backoffice > /dev/null 2>&1; echo $?"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
    command finished in 345ms
  * executing "id -g backoffice > /dev/null 2>&1; echo $?"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
    command finished in 171ms
  * executing "git config user.name || true"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
    command finished in 180ms
  * executing "git config user.email || true"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
    command finished in 212ms
  * executing "groups"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
    command finished in 126ms
    triggering after callbacks for `preflight:check'
  * 2014-02-08 13:47:33 executing `ruby:preflight'
  * executing "grep rails /home/backoffice/app/Gemfile > /dev/null 2>&1; echo $?"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
    command finished in 133ms
  * 2014-02-08 13:47:34 executing `bundle:check_installed'
  * executing "sudo -p 'sudo password: ' su - backoffice -c 'cd . && bundle --version > /dev/null 2>&1'; echo $?"
    servers: ["37.139.3.200"]
    [37.139.3.200] executing command
Password:
    command finished in 1774ms
The application user 'backoffice' cannot execute `bundle`.  Please check you have bundler installed.

If i ssh to server using my account I am able to execute failing command successfully:

petr@prehash:~$ sudo -p 'sudo password: ' su - backoffice -c 'cd . && bundle --version > /dev/null 2>&1'; echo $?
0

If i login to backoffice acccount (application user). I am able to do:

petr@prehash:~$ sudo su backoffice
$ bundle
Could not locate Gemfile
$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]

Which seems to be fine. I've tried to install ruby to the system, rvm and rbenv. All ending with the same error. Obviously I am missing something.

Thx for any hint.

@evserykh
Copy link

I have the same problem 👍

@tomafro
Copy link
Owner

tomafro commented Feb 24, 2014

If you do sudo su - backoffice can you still run bundle?

@evserykh
Copy link

Yes, I can

@naemono
Copy link

naemono commented May 1, 2014

In our case this issue turned out to be sudo complaining about not being able to resolve hostname. Ours was a system begins auto scale so we didn't really care about hostname.

Maybe the task that checks return code should only look at last line?

@saltvedt
Copy link

saltvedt commented May 7, 2014

Ran into this problem as well. For me this problem occurred due to a stray "export" in .bashrc, causing the environment variables to be printed at each login. I think this error can pop up if locales are misconfigured as well.

Even if the code is ok, at the very least the error message is misleading. It is in some cases possible to execute bundler even if exit_code_as_app of 'bundler --version' != 0.

@pkordel
Copy link

pkordel commented Mar 14, 2015

Actually, this code fails with -su: bundle: command not found:

sudo -p 'sudo password: ' su - myapp -c 'cd . && bundle --version'

Clarification, I use rbenv to manage this appuser

@attilagyorffy
Copy link

@pkordel have you managed to get recap to work with rbenv?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants