我正在尝试使用 Capistrano 在 Rails 应用程序上实现 ruby,我在暂存服务器中运行 apache rvm,在生产服务器中运行 nginx REE 版本。我也在使用 git。我一直在尝试集成 Capistrano,但我收到了这个错误
(Net::SSH::AuthenticationFailed: ubuntu)
这是我的 deploy.rb 文件
set :application, "capify"
# The directory on the EC2 node that will be deployed to
set :deploy_to, "/home/ubuntu/apps/#{application}"
set :keep_releases, 3
# deploy with git
set :scm, :git
set :repository, "git@github.com:username/capify.git"
set :git_shallow_clone, 1
set :branch, "master"
set :use_sudo, false
set :user, "ubuntu"
ssh_options[:keys] = ["/path/tp/key.pem"]
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
# The address of the remote host on EC2 (the Public DNS address)
set :location, "ip"
# setup some Capistrano roles
role :app, location
role :web, location
role :db, location, :primary => true
after 'deploy:update_code', 'deploy:symlink_db'
namespace :deploy do
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{deploy_to}/#{shared_dir}/tmp/restart.txt"
end
desc "Symlinks the database.yml"
task :symlink_db, :roles => :app do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
end
end
无法确定确切的问题和整合 capistrano 的方法。