在本地用 VirtualBox 搭了 ubuntu 然后测试用 capistrano3 部署 设置成下面这样。
/* Gem */
gem 'capistrano-rails', group: :development
/* deploy.rb */
set :application, "my-blog"
set :deploy_user, 'XXX'
set :scm, :git
set :repo_url, "[email protected]:XXX/XXX.git"
set :deploy_to, "/home/my-blog"
set :branch, "master"
set :linked_files, %w{config/database.yml config/config.yml}
set :linked_dirs, %w{bin log tmp vendor/bundle public/system}
/* deploy/production.rb */
server '192.168.1.81',
user: 'lu',
roles: %w{web app},
ssh_options: {
user: 'lu', # overrides user setting above
keys: %w(/home/user_name/.ssh/id_rsa),
forward_agent: false,
auth_methods: %w(publickey password)
# password: 'please use keys'
}
/* Capfile */
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
报这样的错
INFO [154ddadf] Running /usr/bin/env mkdir -pv /home/my-blog/shared /home/my-blog/releases on 192.168.1.81
DEBUG [154ddadf] Command: /usr/bin/env mkdir -pv /home/my-blog/shared /home/my-blog/releases
cap aborted!
SSHKit::Command::Failed: mkdir exit status: 1
mkdir stdout: Nothing written
mkdir stderr: Nothing written
/Users/luliangshu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.4.0/lib/sshkit/command.rb:98:in `exit_status='