Heroku拉私人github存储库 [英] Heroku pull private github repository
问题描述
我尝试了不同的方法在Rails应用程序 Gemfile 中使用Github私有存储库引用。
1)Gemfile:
gem'my_gem',::git => https://#{github_user}:#{github_pw} @ github.com / me / my_gem.git
'git push heroku'的结果:
获取https:// user:pw@github.com/me /my_gem.git
错误:请求的URL在访问https:// user:pw@github.com/me/my_gem.git/info/refs
时返回错误:401 Git错误:命令`git克隆'https:// user:pw@github.com/me/my_gem.git'/tmp/build_2wxmqutch8gy7/vendor/bundle/jruby/1.9/cache/bundler/git/my_gem-929bddeee3dd4a564c2689e189190073df01431e--bare --no目录/ tmp / build_2wxmqutch8gy7中的-hardlinks失败。
安装的依赖项
然后我发现这篇文章 https://help.github.com/articles/creating-an-oauth-token-for
2)Gemfile:
gem'命令行使用并创建了一个OAuth令牌。 my_gem',:git => https://#{github_oauth_token} @ github.com / me / my_gem.git
结果from'git push heroku':
获取https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git
密码:
Heroku暂停并提示输入密码。
在我的本地机器上:
git clone https:// user:pw@github.com/me /my_gem.git
和
git clone https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git
works perfekt!
本地:
#git --version
git version 1.7.9.5
Heroku:
#heroku run git --version
git version 1.7.0
Heroku的git(版本1.7)不支持使用电子邮件作为用户名Github的存储库。
您必须使用您的Github用户名。
另外,Heroku的git不支持使用oauth token。希望Heroku能够很快升级他们的git,这样他们可以继续让我的生活更轻松: - )
I have tryed different approaches to use a Github private repository reference in a Rails application Gemfile.
1) Gemfile:
gem 'my_gem', :git => "https://#{github_user}:#{github_pw}@github.com/me/my_gem.git"
Result from 'git push heroku':
Fetching https://user:pw@github.com/me/my_gem.git
error: The requested URL returned error: 401 while accessing https://user:pw@github.com/me/my_gem.git/info/refs
Git error: command `git clone 'https://user:pw@github.com/me/my_gem.git' "/tmp/build_2wxmqutch8gy7/vendor/bundle/jruby/1.9/cache/bundler/git/my_gem-929bddeee3dd4a564c2689e189190073df01431e" --bare --no-hardlinks` in directory /tmp/build_2wxmqutch8gy7 has failed.
Dependencies installed
Then I found this article https://help.github.com/articles/creating-an-oauth-token-for-command-line-use and created an OAuth token.
2) Gemfile:
gem 'my_gem', :git => "https://#{github_oauth_token}@github.com/me/my_gem.git"
Result from 'git push heroku':
Fetching https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git
Password:
Heroku stall and prompt for a password.
On my local machine both:
git clone https://user:pw@github.com/me/my_gem.git
and
git clone https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git
works perfekt!
Local:
# git --version
git version 1.7.9.5
Heroku:
# heroku run git --version
git version 1.7.0
Heroku's git (version 1.7) doesn't support using e-mail as username for Github's repositories.
You must use your Github username.
Also, Heroku's git doesn't support using an oauth token.
Hopefully Heroku will upgrade their git soon, so they can continue making my life easier :-)
这篇关于Heroku拉私人github存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!