Capistrano 3.0.1 I do not know how to create a "start" task when using capistrano / rails / assets

When I try to deploy with Capistrano 3.0.1, I get the following error:

cap aborted! Don't know how to build task 'starting' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/lib/capistrano/dsl/task_enhancements.rb:5:in `before' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/tasks/assets.rake:9:in `block in <top (required)>' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/tasks/assets.rake:8:in `<top (required)>' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/rails/assets.rb:1:in `load' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/rails/assets.rb:1:in `<top (required)>' /Users/user/Documents/rails/shop/Capfile:18:in `require' /Users/user/Documents/rails/shop/Capfile:18:in `<top (required)>' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/lib/capistrano/application.rb:22:in `load_rakefile' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/lib/capistrano/application.rb:12:in `run' /Users/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/bin/cap:3:in `<top (required)>' /Users/user/.rvm/gems/ruby-2.0.0-p353/bin/cap:23:in `load' /Users/user/.rvm/gems/ruby-2.0.0-p353/bin/cap:23:in `<main>' /Users/user/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval' /Users/user/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>' (See full trace by running task with --trace) 

This seems to have started when I uncommented the required lines for loading assets and doing the migration to the Capfile:

  # Load DSL and Setup Up Stages require 'capistrano/setup' # Includes tasks from other gems included in your Gemfile # # require 'capistrano/rvm' # require 'capistrano/rbenv' # require 'capistrano/chruby' # require 'capistrano/bundler' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' # Loads custom tasks from `lib/capistrano/tasks' if you have any defined. Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } 

and adding gems to the gemfile:

 gem 'capistrano', '~> 3.0.0' gem 'capistrano-rails', '~> 1.1.0' 

This is similar to the fact that the required resources are loaded before the capistrano default jobs, so they fail because the starting time for startup is not yet defined. I'm not sure how to fix this,

any idea?

thanks

+6
source share
4 answers

“I don’t know how to create a task” errors can be caused by the presence of the “required” lines in the wrong order in the Capfile.

+10
source

There was no line in the Capfile line:

  require 'capistrano/deploy' 

it is responsible for loading deployment tasks.

In the absence of this requirement, tasks will not be downloaded, and they will be absent.

+5
source

Try capistrano from the master, and the rails from the master too.

There will be a new release of both waiting, so it’s best to jump from a pistol:

 gem 'capistrano', github: 'capistrano/capistrano', ref: 'master' gem 'capistrano-rails', github: 'capistrano/rails', ref: 'master' 
0
source

I ran cap -T and got the same error. I was already heading to Google to find solutions, until I realized that the project was not configured for the captain at all.

-1
source

Source: https://habr.com/ru/post/959381/


All Articles