Don't know how to build task 'unicorn:start' Capistrino 3

858 views
Skip to first unread message

Kevin Nguyen

unread,
May 15, 2015, 3:36:44 PM5/15/15
to capis...@googlegroups.com
Versions:
  • Ruby 2.2.2
  • Capistrano 3.4.0
  • Rake / Rails / etc rails 4.2.1
Platform:
  • Working on....Ubuntu 15.04
  • Deploying to... Server
Logs:

deploy@ubuntu:~/apps/miraclegrow2/current$ cap production unicorn:start --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rbenv:validate (first_time)
** Execute rbenv:validate
DEBUG [ff0302a9] Running /usr/bin/env [ -d ~/.rbenv/versions/2.2.2 ] on 192.168.110.142
DEBUG [ff0302a9] Command: [ -d ~/.rbenv/versions/2.2.2 ]
DEBUG [ff0302a9] Finished in 1.866 seconds with exit status 0 (successful).
** Invoke rbenv:map_bins (first_time)
** Execute rbenv:map_bins
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_rails_env
cap aborted!
Don't know how to build task 'unicorn:start'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task_manager.rb:62:in `[]'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:149:in `invoke_task'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/home/deploy/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/home/deploy/.rbenv/versions/2.2.2/bin/cap:23:in `load'
/home/deploy/.rbenv/versions/2.2.2/bin/cap:23:in `<main>'

Files:
  • Capfile 
# Load DSL and set up stages
require 'capistrano/setup'

# Include default deployment tasks
require 'capistrano/deploy'

# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
#
# require 'capistrano/rvm'
require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
# require 'capistrano/passenger'
set :rbenv_ruby, '2.2.2'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }

  • deploy.rb
  • Stage files (production.rb, staging.rb)

Lee Hambley

unread,
May 15, 2015, 3:38:14 PM5/15/15
to Capistrano
I'm not sure where you expect that unicorn task to come from, probably you are looking for a plugin like https://github.com/tablexi/capistrano3-unicorn

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/2cf1c9d1-18ec-4f05-b32e-496afe6d5734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Nguyen

unread,
May 15, 2015, 3:43:06 PM5/15/15
to capis...@googlegroups.com
Thanks, Lee. Can you take a look at my old deploy.rb? I really dont know how to rewrite all of them.

Lee Hambley

unread,
May 15, 2015, 4:10:19 PM5/15/15
to Capistrano

Kevin Nguyen

unread,
May 18, 2015, 9:05:13 AM5/18/15
to capis...@googlegroups.com
Can you rewrite these rules please? Thanks


task :start, :roles => :app do
run
"cd #{deploy_to}/current/; RAILS_ENV=production bundle exec unicorn_rails -c #{unicorn_path} -D"
end

task :stop, :roles => :app do
run
"if [ -e '#{deploy_to}/shared/pids/unicorn.pid' ]; then kill -QUIT cat #{deploy_to}/shared/pids/unicorn.pid; fi"
end

task :restart, :roles => :app do
stop
start

end
end

task :notify_rollbar, :roles => :app do
set :revision, git log -n 1 --pretty=format:"%H"
set :local_user, whoami
set :rollbar_token, 'token_here'
rails_env
= fetch(:rails_env, 'production')
run
"curl https://api.rollbar.com/api/1/deploy/ -F access_token=#{rollbar_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user} >/dev/null 2>&1", :once => true
end

after "deploy:update", "deploy:link_uploads", "deploy:link_receipts"
after
:deploy, 'notify_rollbar'



Lee Hambley

unread,
May 18, 2015, 9:32:10 AM5/18/15
to capis...@googlegroups.com, kevinng...@gmail.com
Please stop spamming the list and our Github issues with your comments. Ask a focused question, we aren't here to rewrite your code for you. Offers of rewriting code for people in the past have been made close to complex changes or where the original poster demonstrated a will to learn or read at least some documentation.

I have placed you back in the "requires moderation to post" membership list here, and will exercise my right to moderate your posts at GitHub as well.
Reply all
Reply to author
Forward
0 new messages