我需要了解爲什麼capistrano不會創建文件夾當前。我使用以下命令:cap deploy:setup,cap deploy:check,cap deploy缺少當前文件夾Capistrano Rails 3.2
但是,當我檢查我的應用程序目錄時,我沒有當前的文件夾。
這是我deploy.rb
# Execute "bundle install" after deploy, but only when really needed
require 'bundler/capistrano'
# Automatically precompile assets
load "deploy/assets"
# RVM integration
require "rvm/capistrano"
# Application name
set :application, "app"
# Application environment
set :rails_env, :production
# Deploy username and sudo username
set :user, "ubuntu"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
#We don't want to use sudo (root) - for security reasons
set :use_sudo, false
#Target ruby version
set :rvm_ruby_string, '1.9.3-p374'
#System-wide RVM installation
set :rvm_type, :user
#We use sudo (root) for system-wide RVM installation
set :rvm_install_with_sudo, true
#git is our SCM
set :scm, :git
#Use github repository
set :repository, "[email protected]:.../CM.git"
#master is our default git branch
set :branch, "master"
#Deploy via github
set :deploy_to, "/var/www/app/#{application}"
set :deploy_via, :remote_cache
#We have all components of the app on the same server
server "125.156.125.125", :app, :web, :db, :primary => true
namespace :deploy do
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
task :symlink_shared do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
end
task :assets do
system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:# {shared_path}/"
end
end
after 'deploy:update_code', 'deploy:symlink_shared'
我不明白的地方是錯誤,如果有人可以幫我嗎? 謝謝
Capistrano應該在您的應用程序部署路徑「發佈」,「共享」和「當前」下創建這些目錄(這是發佈/ xxxx的sym鏈接)不記得,但它可能不會在首次部署之前創建,應用程序似乎被配置爲部署到「/ var/www/app/app」 - 檢查是這種情況並仔細檢查部署用戶擁有目錄 – house9 2013-02-19 18:38:15