尝试使用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)
当我取消注释需要行以加载资产并在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 }
并将Gems添加到Gemfile:
gem 'capistrano','~> 3.0.0' gem 'capistrano-rails','~> 1.1.0'
这就像在默认的capistrano任务之前加载了所需的资产,因此它们会失败,因为尚未定义加载启动的时间.我不知道如何解决这个问题,
任何的想法?
谢谢