简体   繁体   English

capistrano 3.0.1当使用capistrano / rails / assets时,不知道如何构建任务'starting'

[英]capistrano 3.0.1 Don't know how to build task 'starting' when using capistrano/rails/assets

When trying to deploy with Capistrano 3.0.1 I get the following error: 尝试使用Capistrano 3.0.1进行部署时出现以下错误:

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 require rows for loading assets and performing migrations in the Capfile: 当我取消注释需要行以加载资产并在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 the gems to the Gemfile: 并将Gems添加到Gemfile:

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

It's like the required assets are loaded before the default capistrano tasks so they fail because a the time of loading the starting is not yet defined. 这就像在默认的capistrano任务之前加载了所需的资产,因此它们会失败,因为尚未定义加载starting的时间。 I'm not sure how to fix this, 我不知道如何解决这个问题,

any idea? 任何的想法?

thanks 谢谢

“不知道如何构建任务”错误可能是由于Capfile中的'require'行以错误的顺序引起的。

The Capfile was missing the line: Capfile错过了这一行:

 require 'capistrano/deploy'

this is responsible of loading the deployment tasks. 这负责加载部署任务。

Missing that requirement the tasks won't be loaded and they will be missing. 缺少该要求,任务将不会被加载,并且将丢失。

Try capistrano from master, and the rails gem from master too. 试试master中的capistrano,以及来自master的rails gem。

There's a new release of both pending, so might be best to jump the gun: 两个都有待发布的新版本,所以最好跳枪:

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

I did run cap -T and got the same error. 我确实运行了cap -T并得到了同样的错误。 I was already heading out for google looking for solutions, until I realized that the project was not set up for capistrano at all. 我已经开始寻找谷歌寻找解决方案,直到我意识到该项目根本没有设置为capistrano。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不知道如何在使用 Rails 为 capistrano 3.8.0 运行“cap production deploy”时构建任务“start” - Don't know how to build task 'start' when run 'cap production deploy' for capistrano 3.8.0 with Rails 部署引发错误“不知道如何构建任务'资产:预编译'”(Capistrano) - Deploy raise error “Don't know how to build task 'assets:precompile'” (Capistrano) Capistrano:不知道如何构建任务“ deploy:restart” - Capistrano : Don't know how to build task 'deploy:restart' 当我在 Capistrano 任务中将我的应用程序部署到 vps 时,不知道如何构建任务“环境” - Don't know how to build task 'environment' When i deploy my app to vps in Capistrano task Rails 5部署到VPS-capistrano错误“不知道如何构建任务&#39;deploy:setup&#39;” - Rails 5 deploy to VPS - capistrano error “Don't know how to build task 'deploy:setup' ” Capistrano:不知道如何构建任务 &#39;deploy:new_release_path&#39; - Capistrano: Don't know how to build task 'deploy:new_release_path' Capistrano:Cap失败了! 不知道如何建立任务&#39;deploy:setup&#39; - Capistrano: Cap aborted! Don't know how to build task 'deploy:setup' capistrano3:不知道如何构建任务&#39;deploy:create_db&#39; - capistrano3: Don't know how to build task 'deploy:create_db' 卡皮斯特拉诺:帽子流产了! 不知道如何构建任务&#39;deploy:setup_config&#39; - Capistrano: cap aborted! Don't know how to build task 'deploy:setup_config' 启动服务器时(rails s)不知道如何构建任务&#39;deploy&#39;(参见--tasks)(RuntimeError) - When starting server (rails s) Don't know how to build task 'deploy' (see --tasks) (RuntimeError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM