【发布时间】:2014-01-03 07:44:32
【问题描述】:
我正在尝试在 Amazon EC2 上使用 Capistrano 部署我的 Rails 4 应用程序,但我一直收到拒绝访问(公钥)。
executing locally: "git ls-remote git@github.com:myuser/myrepo.git HEAD"
Permission denied (publickey).
fatal: Could not read from remote repository.
在远程服务器上,我可以 git clone 我的 repo。这里:
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, "git@github.com: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 继续部署,我需要什么,因为我已经在服务器上有了我的仓库?提前致谢
【问题讨论】:
标签: ruby-on-rails git amazon-ec2 capistrano