簡體   English   中英

如何在Rails4中使用Capistrano

[英]How to use capistrano in Rails4

我正在使用rails 4和capistrano gem'capistrano','〜> 3.0.0'和'capistrano-rails','〜> 1.1.0'

我在運行cap登載deploy:setup --trace時遇到問題

錯誤:**調用登台(first_time)**執行登台**調用加載:默認值(first_time)**執行加載:默認值capistrano / ext / multistage需要Capistrano 2

我已經在deploy.rb文件中包含了“ require capistrano / ext / multistage”

deploy.rb文件


 #require "bundler/capistrano"
 require 'capistrano/ext/multistage'

 set :application, 'management.zisoo.nl'
 # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }

 # set :deploy_to, '/var/www/my_app'
 set :scm, :git
 set :repo_url, 'https://brails@bitbucket.org/johnmuller/motoronderdelen.nl.git'
 set :stages, %w(production staging dev)
 set :default_stage, "staging"

 #set :user, "server-user-name"

 # set :format, :pretty
 # set :log_level, :debug
 # set :pty, true

 # set :linked_files, %w{config/database.yml}
 # set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle
   public/system}

 # set :default_env, { path: "/opt/ruby/bin:$PATH" }
 # set :keep_releases, 5

 namespace :deploy do

   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 :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

 after :finishing, 'deploy:cleanup'

結束

由於capistrano-rails依賴性問題,您需要在Gemfile指定Capistrano的版本2,例如:

gem 'capistrano', '~> 2.15'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM