Note that there are some explanatory texts on larger screens.

plurals
  1. POCapistrano 3 use unknown bundler and stderr with custom task
    text
    copied!<p>My Capfile:</p> <pre><code># Load DSL and Setup Up Stages require 'capistrano/setup' # Includes default deployment tasks require 'capistrano/deploy' # Includes tasks from other gems included in your Gemfile # # For documentation on these, see for example: # # https://github.com/capistrano/rvm # https://github.com/capistrano/rbenv # https://github.com/capistrano/chruby # https://github.com/capistrano/bundler # https://github.com/capistrano/rails/tree/master/assets # https://github.com/capistrano/rails/tree/master/migrations # require 'capistrano/rvm' # require 'capistrano/rbenv' # require 'capistrano/chruby' require 'capistrano/bundler' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' require 'sidekiq/capistrano' # Loads custom tasks from `lib/capistrano/tasks' if you have any defined. Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } </code></pre> <p>deploy.rb:</p> <pre><code>set :application, 'myapp' set :user, 'deployer' set :repo_url, "git@bitbucket.org:citicom/#{fetch :application}.git" # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } set :deploy_to, "/home/#{fetch :user}/apps/#{fetch :application}" # set :scm, :git set :format, :pretty # set :log_level, :debug set :pty, true set :linked_files, %w{config/database.yml config/application.yml} set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets tmp/sock vendor/bundle public/system} # set :default_env, { path: "/opt/ruby/bin:$PATH" } set :keep_releases, 3 # for RoR 4 set :default_env, { rvm_bin_path: '~/.rvm/bin' } set :bundle_gemfile, -&gt; { release_path.join('Gemfile') } set :bundle_dir, -&gt; { shared_path.join('bundle') } set :bundle_flags, '' set :bundle_without, %w{test development}.join(' ') set :bundle_binstubs, -&gt; { shared_path.join('bin') } set :bundle_roles, :all namespace :deploy do desc 'Restart application' task :restart do on roles(:app), in: :sequence, wait: 5 do # Your restart mechanism here, for example: run "cd #{current_path} &amp;&amp; /etc/init.d/unicorn_#{fetch :application} restart" # execute :touch, release_path.join('tmp/restart.txt') end end after :restart, :clear_cache do on roles(:web), in: :groups, limit: 3, wait: 10 do # Here we can do anything such as: # within release_path do # execute :rake, 'cache:clear' # end end end after :finishing, 'deploy:cleanup' end </code></pre> <p>Error:</p> <pre><code>git:(master) ✗ cap production bundler:install /Users/quatermain/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777 /Users/quatermain/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777 DEBUG [55d61c51] Running if test ! -d /home/deployer/apps/myapp/current; then echo "Directory does not exist '/home/deployer/apps/myapp/current'" 1&gt;&amp;2; false; fi on 134.19.136.197 DEBUG [55d61c51] Command: if test ! -d /home/deployer/apps/myapp/current; then echo "Directory does not exist '/home/deployer/apps/myapp/current'" 1&gt;&amp;2; false; fi DEBUG [55d61c51] Finished in 0.895 seconds with exit status 0 (successful). INFO [166054bd] Running /bin/myapp_bundle --gemfile /home/deployer/apps/myapp/current/Gemfile --path /home/deployer/apps/myapp/shared/bundle --binstubs /home/deployer/apps/myapp/shared/bin --without test development on 134.19.136.197 DEBUG [166054bd] Command: cd /home/deployer/apps/myapp/current &amp;&amp; ( RVM_BIN_PATH=~/.rvm/bin /bin/myapp_bundle --gemfile /home/deployer/apps/myapp/current/Gemfile --path /home/deployer/apps/myapp/shared/bundle --binstubs /home/deployer/apps/myapp/shared/bin --without test development ) DEBUG [166054bd] zsh:1: no such file or directory: /bin/myapp_bundle cap aborted! bundle stdout: Nothing written bundle stderr: Nothing written /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/command.rb:94:in `exit_status=' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:125:in `block (4 levels) in _execute' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `call' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `do_request' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:561:in `channel_request' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:269:in `wait' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:147:in `block (2 levels) in _execute' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `call' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:149:in `block in _execute' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:106:in `tap' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:106:in `_execute' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:54:in `execute' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-bundler-1.0.0/lib/capistrano/tasks/bundler.cap:20:in `block (4 levels) in &lt;top (required)&gt;' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/abstract.rb:81:in `within' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-bundler-1.0.0/lib/capistrano/tasks/bundler.cap:19:in `block (3 levels) in &lt;top (required)&gt;' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:42:in `instance_exec' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb:42:in `run' /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' Tasks: TOP =&gt; bundler:install (See full trace by running task with --trace) </code></pre> <p>I used capistrano 2 but when I updated capistrano to version 3 I have this error with two my ROR 4 app. Why capistrano use '/bin/myapp_bundle'? </p> <p>----------- UPDATE -----------</p> <p>@mpapis help me with it: </p> <pre><code>cap productiom rvm:hook deploy </code></pre> <p>and it's working, but when I created custom task with mpapis help: </p> <pre><code>namespace :whenever do desc "Update application's crontab entries using Whenever" task :update_crontab do on roles(:app) do execute "cd /home/deployer/apps/fxfinvis/current/ &amp;&amp; bundle exec whenever -w RAILS_ENV=#{fetch :rails_env}" end end before :update_crontab, 'rvm:hook' end before "deploy:finishing", "whenever:update_crontab" # If anything goes wrong, undo. after "deploy:finishing_rollback", "whenever:update_crontab" </code></pre> <p>and I have same error:</p> <pre><code>cap production whenever:update_crontab /Users/quatermain/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777 /Users/quatermain/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local/share/npm/lib/node_modules in PATH, mode 040777 INFO [1372d0e2] Running cd /home/deployer/apps/fxfinvis/current/ &amp;&amp; bundle exec whenever -w RAILS_ENV=production on 134.19.136.197 DEBUG [1372d0e2] Command: cd /home/deployer/apps/fxfinvis/current/ &amp;&amp; bundle exec whenever -w RAILS_ENV=production cap aborted! cd /home/deployer/apps/fxfinvis/current/ &amp;&amp; bundle exec whenever -w RAILS_ENV=production stdout: Nothing written cd /home/deployer/apps/fxfinvis/current/ &amp;&amp; bundle exec whenever -w RAILS_ENV=production stderr: Nothing written /Users/quatermain/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.1.0/lib/sshkit/command.rb:94:in `exit_status=' .... </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload