致命:无法读取'https://github.com'的用户名:没有这样的设备或地址 [英] Fatal: could not read Username for 'https://github.com': No such device or address

查看:3956
本文介绍了致命:无法读取'https://github.com'的用户名:没有这样的设备或地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用github和capistrano将我的Rails 4应用程序部署到Rackspace几周。一切工作正常,直到我最终使我的存储库私有。现在,我在运行'cap deploy'后收到以下错误:


$ b

致命:无法读取 https://username@github.com :没有这样的设备或地址



以下是代码从我的deploy.rb文件

  set:application,appname
set:repository,https:// git_username@github.com/git_username/appname.git
set:scm,:git
set:scm_username,git_username
set:scm_passphrase,git_password
set: scm_command,git
set:keep_releases,5
set:branch,master
set:rails_env,production
$ b set:deploy_to,/ var / www / doLocal

set:user,deployer
set:password,deployer_password
set:use_sudo,false

ssh_options [:forward_agent] = true

server/ path / to / server,:app,:web,:db,:primary =>真正的

在deploy:restart,deploy:cleanup之后


命名空间:deploy do
task:start do;结束
任务:停止做;结束
任务:重新启动,:roles => :app,:except => {:no_release => true} do
run#{try_sudo} touch#{File.join(current_path,'tmp','restart.txt')}
end
end

我已经试过它,并且没有将用户名前置到github存储库名称。如果它在那里,我收到上面的密码错误,但如果它不在那里,我收到以下错误:



致命:无法读取用户名' https://github.com ':没有这样的设备或地址



任何想法是什么问题?我假设它与我更改为私有存储库有关。我已经阅读了一些关于使用ssh的内容,但也读过了。



任何建议或帮助将不胜感激! 所以 , 我想到了。为了在Github上使用私人回购来部署使用https,您需要使用Github的OAuth API。在您的github账户编辑配置文件下,点击应用程序,然后生成OAuth令牌。然后,将您的令牌前置到您的repo url中,如下所示:

  set:repository,https://< OAuthToken> @ github.com/username/application.git

之后,我可以运行

  cap deploy 



<并将我的应用程序部署到远程服务器。


I have been deploying my Rails 4 application to Rackspace using github and capistrano for a few weeks now. Everything worked fine until I finally made my repository private. Now, I am receiving the following error after running 'cap deploy':

"fatal: could not read Password for 'https://username@github.com': No such device or address"

Below is the code from my deploy.rb file

set :application, "appname"
set :repository,  "https://git_username@github.com/git_username/appname.git"
set :scm, :git
set :scm_username, "git_username"
set :scm_passphrase, "git_password"
set :scm_command, "git"
set :keep_releases, 5
set :branch, "master"
set :rails_env, "production"

set :deploy_to, "/var/www/doLocal"

set :user, "deployer"
set :password, "deployer_password"
set :use_sudo, false

ssh_options[:forward_agent] = true

server "/path/to/server", :app, :web, :db, :primary => true

after "deploy:restart", "deploy:cleanup"


namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end

I have tried it with and without the username prepended to the github repository name. If it is there, I receive the password error from above, but if it is not there, I receive the following error:

"fatal: could not read Username for 'https://github.com': No such device or address"

Any idea what the issue is? I'm assuming it has something to do with me changing to a private repository. I have read some things about using ssh but have also read not to.

Any suggestions or help would be much appreciated!

解决方案

So, I figured it out. In order to use a private repo on Github to deploy using https, you need to use Github's OAuth API. Under Edit Profile on your github account, click applications and then generate an OAuth Token. Then, prepend your token to your repo url like so:

 set :repository,  "https://<OAuthToken>@github.com/username/application.git"

After that, I was able to run

 cap deploy

and deploy my application to my remote server.

这篇关于致命:无法读取'https://github.com'的用户名:没有这样的设备或地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆