2013-12-16 171 views
1

我正在尝试在Amazon EC2上部署我的应用程序Rails 4应用程序与Capistrano,但我一直在获取Acess Denied(publickey)。Capistrano部署权限被拒绝

executing locally: "git ls-remote [email protected]:myuser/myrepo.git HEAD" 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

在远程服务器上,我能够克隆我的回购。在这里:

Initialized empty Git repository in /home/ec2-user/myrepo/.git/ 
remote: Counting objects: 2573, done. 
remote: Compressing objects: 100% (1208/1208), done. 
remote: Total 2573 (delta 1434), reused 2364 (delta 1225) 
Receiving objects: 100% (2573/2573), 26.76 MiB | 2.64 MiB/s, done. 
Resolving deltas: 100% (1434/1434), done. 

这意味着服务器上,并在GitHub上的SSH密钥确定 - 但我相信,我失去了一些东西在我的deploy.rb

这里是deploy.rb

set :application, "musicjungle" 

ssh_options[:keys] = ['~/.ssh/server.pem'] #(This key if the one that I use to connect the instance, I belieive that my error might be here...) 
set :scm, "git" 
set :repository, "[email protected]:myuser/myrepo.git" 
set :deploy_via, :remote_cache 

set :user, 'ec2-user' 
set :deploy_to, "/var/www/musicjungle" 

set :bundle_without, [:development, :test, :staging] 
server '54.200.x.x', :app, :primary =>true 

不知道我是否需要提供更多细节,但它似乎是我失踪的新手。如果我不使用capistrano来继续部署,我需要什么,因为我已经在服务器上有我的回购了?在此先感谢

回答

2

在您的第一行中,它表示权限问题发生在本地。在您的本地机器上,尝试运行相同的命令:

$ git ls-remote [email protected]:myuser/myrepo.git HEAD 

很可能您没有将本地SSH密钥添加到Github。

相关问题