Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbenv-capistrano compatibility redux? #6

Open
mauriciopasquier opened this issue Jun 11, 2015 · 3 comments
Open

rbenv-capistrano compatibility redux? #6

mauriciopasquier opened this issue Jun 11, 2015 · 3 comments

Comments

@mauriciopasquier
Copy link

I'm having an issue and I think is related with #3

This is the generated CMD:

CMD="cd /path/to/deploy/current && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 /usr/bin/env HOME=/home/right_user RAILS_ENV=production nice -n 15 bundle exec bin/delayed_job $op -n 10 )"

It fails at finding bundle (nice: bundle: No such file or directory). Adding the following before bundle exec makes it work:

~/.rbenv/bin/rbenv exec

So the working command is:

CMD="cd /path/to/deploy/current && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 /usr/bin/env HOME=/home/right_user RAILS_ENV=production nice -n 15 ~/.rbenv/bin/rbenv exec bundle exec bin/delayed_job $op -n 10 )"

Maybe it's something wrong with my setup?

capistrano (3.4.0)
capistrano-bundler (1.1.4)
capistrano-delayed-job (1.1.0)
capistrano-rails (1.1.3)
capistrano-rbenv (2.0.3)
@antillas21
Copy link

I can confirm that @mauriciopasquier working command recommendation does make this work 👍

@tc4mpbell
Copy link

Just to note, I was seeing a similar error related to .rbenv and this delayed job gem:

Relevant cap deploy log:

Invoking DelayedJob with command 'stop'
DEBUG [e405db75]    Agent pid 13227
DEBUG [e405db75]    Identity added: /home/deploy/.ssh/id_rsa (/home/deploy/.ssh/id_rsa)
DEBUG [e405db75]    /home/deploy/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/bundler-1.7.6/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find devise-3.5.3 in any of the sources (Bundler::GemNotFound)
...

The specific gem didn't matter, it just wasn't executing with the right Ruby version and couldn't find any gems that I'd added.

This was the command this plugin is running that errored out:

export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.2.2" ; /usr/bin/env sudo service delayed_job_se_health_uat restart

I switched to this gem (https://github.com/platanus/capistrano3-delayed-job), and it works -- the command it's running is this:

export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.2.2" RAILS_ENV="uat" ; $HOME/.rbenv/bin/rbenv exec bundle exec bin/delayed_job -n 1 restart

Hope that's helpful.

@netuoso
Copy link

netuoso commented Mar 4, 2016

I know this is old .. but I just had to use these instructions with version 1.1.0

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

No branches or pull requests

4 participants