简体   繁体   English

卡皮斯特拉诺:帽子流产了! 不知道如何构建任务'deploy:setup_config'

[英]Capistrano: cap aborted! Don't know how to build task 'deploy:setup_config'

I'm deploying a Rails 4.0 app to an ubuntu server using capistrano 3.2.1 but I'm getting the error when I try running capistrano commands. 我正在使用capistrano 3.2.1将Rails 4.0应用程序部署到ubuntu服务器,但是当我尝试运行capistrano命令时,我收到错误。

cap aborted!
Don't know how to build task 'deploy:setup_config'

This are the commands I have tried 这是我试过的命令

cap production rvm:check
cap production deploy

Here is my deploy.rb file 这是我的deploy.rb文件

lock '3.2.1'

set :application, 'app_name'
set :repo_url, 'git@github.com:GITUSERNAME/REPO.git'

set :deploy_user, 'deploy'
set :use_sudo, false

set :ssh_options, {:forward_agent => true, :keys => %w(/home/USER/.ssh/id_rsa)}

# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call

# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/var/www/app_name'


 set :scm, :git
 set :scm_passphrase, ""

 set :format, :pretty
 set :log_level, :debug

set :linked_files, %w{config/database.yml}

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

 set :keep_releases, 5

set :tests, []
set(:config_files, %w(
  nginx.config
  database.example.yml
  ))

set(:symlinks, [
  {
    source: "nginx.conf",
    link: "etc/nginx/sites-enabled/#{fetch(:full_app_name)}"
  }
  ])


namespace :deploy do
  before :deploy, "deploy:check_revision"
  before :deploy, "deploy:run_tests"
  before 'deploy:setup_config', 'nginx:remove_default_vhost' 

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      # Your restart mechanism here, for example:
       execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after 'deploy:smylink:shared', 'deploy:compile_assets_locally'
  after :finishing, 'deploy:cleanup'

  after 'deploy:setup_config', 'nginx:reload'
  after :publishing, :restart

  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

end

here is my Capfile.rb 这是我的Capfile.rb

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/rails'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

production.rb production.rb

set :stage, :production
set :branch, "master"
set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}"
set :server_name, "SERVERURL"
set :rails_env, :production
role :app, %w{deploy@example.com}
role :web, %w{deploy@example.com}
role :db,  %w{deploy@example.com}
server 'SERVERURL', user: 'deploy', roles: %w{web app db}, primary: :true

I know there is no cap deploy:setup_config command in capistrano 3. What am I not doing right? 我知道capistrano中没有cap deploy:setup_config命令3.我做得对不对?

You need 你需要

 cap deploy:setup

not

 cap deploy:setup_config

Checkout this for more info 查看信息以获取更多信息

暂无
暂无

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

相关问题 Capistrano:Cap失败了! 不知道如何建立任务'deploy:setup' - Capistrano: Cap aborted! Don't know how to build task 'deploy:setup' 不知道如何在使用 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 Rails 5部署到VPS-capistrano错误“不知道如何构建任务'deploy:setup'” - Rails 5 deploy to VPS - capistrano error “Don't know how to build task 'deploy:setup' ” 卡波斯特拉诺:上限中止! 不知道如何构建任务“开始”(使用 `cap --tasks` 查看可用任务列表) - Capostrano: cap aborted! Don't know how to build task 'start' (See the list of available tasks with `cap --tasks`) Capistrano:不知道如何构建任务“ deploy:restart” - Capistrano : Don't know how to build task 'deploy:restart' 耙子流产了! 不知道如何建立任务“部署” - Rake aborted! Don't know how to build task 'deploy' 耙子中止! 不知道如何构建任务 'snorby:setup' - rake aborted! Don't know how to build task 'snorby:setup' 当我在 Capistrano 任务中将我的应用程序部署到 vps 时,不知道如何构建任务“环境” - Don't know how to build task 'environment' When i deploy my app to vps in Capistrano task Capistrano:不知道如何构建任务 'deploy:new_release_path' - Capistrano: Don't know how to build task 'deploy:new_release_path' capistrano3:不知道如何构建任务'deploy:create_db' - capistrano3: Don't know how to build task 'deploy:create_db'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM