ruby-on-rails - capistrano 部署在 git ls-remote 调用上询问用户名/密码

标签 ruby-on-rails ruby-on-rails-3 git github capistrano

Capistrano 的第一次用户,我已经设置了我能告诉的最好的部分,但是当我运行 cap deploy 时,我得到以下询问我的 github 用户名

Fri Dec 02$ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "git ls-remote https://github.com/uname/repo HEAD"
Username: 

我假设这在我的 OS X 笔记本电脑上本地运行。如果我运行 git ls-remote https://github.com/uname/repo,系统会提示我输入用户名。但是,我可以正常运行 git clone 这个存储库,这让我认为本地 ssh key 设置正确。我在这里缺少什么?

谢谢

编辑 #1 - deploy.rb 的顶部

set :application, "test-rails"
set :repository,  "https://github.com/uname/app"

set :scm, :git
set :user, "deploy"
set :deploy_to, "/data/sites/site.com/apps/#{application}"
set :use_sudo, false
set :keep_releases, 5

role :web, "173.230.xxx.xxx"

最佳答案

您使用的是 HTTPS 网址。这将忽略您的 SSH key ,并且您必须通过 HTTPS 进行基本身份验证。您希望您的 URL 改为 ssh://git@github.com/uname/repo

(克隆之所以有效,是因为您可以匿名克隆并且不需要进行身份验证。)

关于ruby-on-rails - capistrano 部署在 git ls-remote 调用上询问用户名/密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8361563/

相关文章:

ruby - 在 rails gem 上 fork 和工作的指南

ruby-on-rails - rails 3 : Why am I getting EOFError with DELETE request and no form body?

linux - 两台远程服务器上的 git diff(在 git git --no-index 之外)

ruby-on-rails - NoMethodError : undefined method `stub' for ModuleX:Module

ruby - float 域错误

git - 使用带有格式的bash列出目录中的git分支

git 和 git-svn 和多个分支以及推送和获取

ruby-on-rails - 在 linux 上运行的新应用程序的单声道还是 RoR?

javascript - 如何使用 Ajax/Ruby on Rails 在 View 中呈现 Controller 变量?

ruby-on-rails - Rspec 3 并断言该值具有对象 ID