Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 Capistrano Deploy要求输入Git的用户名,但在我输入之前移动到新行_Ruby On Rails 3_Github_Capistrano - Fatal编程技术网

Ruby on rails 3 Capistrano Deploy要求输入Git的用户名,但在我输入之前移动到新行

Ruby on rails 3 Capistrano Deploy要求输入Git的用户名,但在我输入之前移动到新行,ruby-on-rails-3,github,capistrano,Ruby On Rails 3,Github,Capistrano,使用Capistrano部署my rail 3应用程序时,将进入Capistrano执行以下命令的步骤: * executing "if [ -d /var/www/appname/shared/cached-copy ]; then cd /var/www/dflabs1/shared/cached-copy && git fetch -q origin && git fetch --tags -q origi n && git reset

使用Capistrano部署my rail 3应用程序时,将进入Capistrano执行以下命令的步骤:

   * executing "if [ -d /var/www/appname/shared/cached-copy ]; then cd /var/www/dflabs1/shared/cached-copy && git fetch -q origin && git fetch --tags -q origi
n && git reset -q --hard d0a1373a3634935de1a75f377698ba53574fe580 && git clean -q -d -x -f; else git clone -q https://github.com/username/dflabs1.git /va
r/www/appname/shared/cached-copy && cd /var/www/appname/shared/cached-copy && git checkout -q -b deploy d0a1373a3634935de1a75f377698ba53574fe580; fi"
    servers: ["11.10.1.162"]
Password: 
    [11.10.1.162] executing command
 ** [11.10.1.162 :: out] Username for 'https://github.com':
问题是当它输出“Username for”时https://github.com“,光标跳到新行,不允许我输入用户名。如果我尝试在新行中输入用户名,部署将什么也不做。这是在Ubuntu12.04桌面和Ubuntu12.04服务器之间发生的


我尝试将“set:scm\u username”选项添加到deploy.rb,但没有效果。我在Ubuntu终端和Aptana内部的终端视图中进行了尝试。

尝试将部署服务器的SSH密钥导入GitHub

您可以在此处执行此操作:。 您可以在此处找到SSH密钥教程(Github):

[编辑] 实际上,我只是自己做的,并检查了输出

是否确实设置了
set:repository,“git@github.com:[GitHub User]/[GitHub Repository Name].git“
在deploy.rb中是否正确

因为你的

else git clone -q https://github.com/username/dflabs1.git
看起来像

else git clone -q git@github.com:[GitHub-User]/[GitHub-Repository-Name].git

当使用SSH或httpauth时,它也会做同样的事情。我可能决定从本地部署,而不是从github master部署,服务器在内部,存储库很小。