gpt4 book ai didi

ruby-on-rails - 卡皮斯特拉诺:上限失败!不知道如何构建任务 'deploy:setup_config'

转载 作者:行者123 更新时间:2023-12-02 11:10:49 25 4
gpt4 key购买 nike

我正在使用 capistrano 3.2.1 将 Rails 4.0 应用程序部署到 ubuntu 服务器,但当我尝试运行 capistrano 命令时遇到错误。

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

这是我尝试过的命令

cap production rvm:check
cap production deploy

这是我的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

这是我的Capfile.rb

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

生产.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

我知道 capistrano 3 中没有 cap deploy:setup_config 命令。我哪里做错了?

最佳答案

你需要

 cap deploy:setup

不是

 cap deploy:setup_config

结账 this了解更多信息

关于ruby-on-rails - 卡皮斯特拉诺:上限失败!不知道如何构建任务 'deploy:setup_config',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24120002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com