capistrano-plugins / capistrano-delayed-job Goto Github PK
View Code? Open in Web Editor NEWCapistrano tasks for automatic and sensible DelayedJob configuration
License: MIT License
Capistrano tasks for automatic and sensible DelayedJob configuration
License: MIT License
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)
Hi Ruben,
When I do a
$ cap staging delayed_jobs:start
it lets out the following error on console:
Running /usr/bin/env sudo service delayed_job_bubblin_staging start on bubbl.in
DEBUG[a02bb5f7] Command: ( RBENV_ROOT=/.rbenv RBENV_VERSION=2.1.3 /usr/bin/env sudo service delayed_job_bubblin_staging start )/.rbenv RBENV_VERSION=2.1.3 ~/.rbenv/bin/rbenv exec bundle exec bin/delayed_job start -n 1 )'
DEBUG[a02bb5f7] Invoking DelayedJob with command 'start'
DEBUG[a02bb5f7] -su: -c: line 0: syntax error near unexpected token (' DEBUG[a02bb5f7] -su: -c: line 0:
cd /var/www/bubblin/current && HOME=/home/deployer RAILS_ENV=production nice -n 15 ( RBENV_ROOT=
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host bubbl.in: sudo exit status: 1
sudo stdout: Nothing written
sudo stderr: Nothing written
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/command.rb:97:in exit_status=' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:148:in
block (5 levels) in _execute'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in call' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in
do_request'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in channel_request' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in
dispatch_incoming_packets'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in preprocess' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in
process'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in block in loop' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in
loop'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in loop' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in
wait'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:170:in block (3 levels) in _execute' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in
call'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in do_open_confirmation' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in
channel_open_confirmation'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in dispatch_incoming_packets' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in
preprocess'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in process' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in
block in loop'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in loop' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in
loop'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:172:in block (2 levels) in _execute' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in
with_ssh'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in block in _execute' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in
tap'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in _execute' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:66:in
execute'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/dsl.rb:27:in sudo' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/capistrano-delayed-job-1.0.1/lib/capistrano/tasks/delayed_job.rake:39:in
block (4 levels) in <top (required)>'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in instance_exec' /Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in
run'
/Users/admin/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
SSHKit::Command::Failed: sudo exit status: 1
Any clues to what this is? Is it in someway related to the bash?
Most of the capistrano tasks that I've are now running successfully. Stuck on delayed_jobs with the following trace:
marvin$ cap production delayed_job:start
DEBUG[e9bbca06] Running /usr/bin/env [ -d ~/.rvm ] on bubbl.in
DEBUG[e9bbca06] Command: [ -d ~/.rvm ]
DEBUG[e9bbca06] Finished in 0.808 seconds with exit status 1 (failed).
DEBUG[52554232] Running /usr/bin/env [ -d /usr/local/rvm ] on bubbl.in
DEBUG[52554232] Command: [ -d /usr/local/rvm ]
DEBUG[52554232] Finished in 0.044 seconds with exit status 0 (successful).
DEBUG[515bbf73] Running /usr/local/rvm/bin/rvm version on bubbl.in
DEBUG[515bbf73] Command: /usr/local/rvm/bin/rvm version
DEBUG[515bbf73] rvm 1.25.33 (stable) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]
DEBUG[515bbf73]
DEBUG[515bbf73] Finished in 0.266 seconds with exit status 0 (successful).
rvm 1.25.33 (stable) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]
DEBUG[748c4139] Running /usr/local/rvm/bin/rvm current on bubbl.in
DEBUG[748c4139] Command: /usr/local/rvm/bin/rvm current
DEBUG[748c4139] ruby-2.1.2
DEBUG[748c4139]
DEBUG[748c4139] Finished in 0.265 seconds with exit status 0 (successful).
ruby-2.1.2
DEBUG[cc6d0cea] Running /usr/local/rvm/bin/rvm 2.1.2 do ruby --version on bubbl.in
DEBUG[cc6d0cea] Command: /usr/local/rvm/bin/rvm 2.1.2 do ruby --version
DEBUG[cc6d0cea] ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
DEBUG[cc6d0cea]
DEBUG[cc6d0cea] Finished in 0.483 seconds with exit status 0 (successful).
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
INFO[dfd09347] Running /usr/bin/env sudo service delayed_job_bubblin_production start on bubbl.in
DEBUG[dfd09347] Command: /usr/bin/env sudo service delayed_job_bubblin_production start
DEBUG[dfd09347] Invoking DelayedJob with command 'start'
DEBUG[dfd09347]
DEBUG[dfd09347] [31mbundler: command not found: bin/delayed_job[0m
DEBUG[dfd09347]
DEBUG[dfd09347] [33mInstall missing gem executables with bundle install
[0m
DEBUG[dfd09347]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host bubbl.in: sudo exit status: 127
sudo stdout: Nothing written
sudo stderr: Nothing written
What does exit status: 127 mean? How to fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.