ruby-on-rails – Capistrano:帽子流产!不知道如何构建任务’deploy:setup_config’

ruby-on-rails – Capistrano:帽子流产!不知道如何构建任务’deploy:setup_config’,第1张

概述我正在使用capistrano 3.2.1将Rails 4.0应用程序部署到ubuntu服务器,但是当我尝试运行capistrano命令时,我收到错误. cap aborted!Don't know how to build task 'deploy:setup_config' 这是我试过的命令 cap production rvm:checkcap production deploy 这是我 我正在使用cAPIstrano 3.2.1将Rails 4.0应用程序部署到ubuntu服务器,但是当我尝试运行cAPIstrano命令时,我收到错误.

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

这是我试过的命令

cap production rvm:checkcap production deploy

这是我的deploy.rb文件

lock '3.2.1'set :application,'app_name'set :repo_url,'[email protected]:GITUSERname/REPO.git'set :deploy_user,'deploy'set :use_sudo,falseset :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_appset :deploy_to,'/var/www/app_name' set :scm,:git set :scm_passphrase,"" set :format,:pretty set :log_level,:deBUGset :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,5set :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  endend

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

set :stage,:productionset :branch,"master"set :full_app_name,"#{fetch(:application)}_#{fetch(:stage)}"set :server_name,"SERVERURL"set :rails_env,:productionrole :app,%w{[email protected]}role :web,%w{[email protected]}role :db,%w{[email protected]}server 'SERVERURL',user: 'deploy',roles: %w{web app db},primary: :true

我知道cAPIstrano中没有cap deploy:setup_config命令3.我做得对不对?

解决方法 你需要

cap deploy:setup

cap deploy:setup_config

结帐this了解更多信息

总结

以上是内存溢出为你收集整理的ruby-on-rails – Capistrano:帽子流产!不知道如何构建任务’deploy:setup_config’全部内容,希望文章能够帮你解决ruby-on-rails – Capistrano:帽子流产!不知道如何构建任务’deploy:setup_config’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1269853.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存