2011-08-17 14 views
21

から宝石をインストールし、私はGitのプライベートリポジトリから宝石をバンドルするトラブルを持っている:バンドル:プライベートgithubのリポジトリ

gem 'test', :git => 'git://github.com/my_account/test.git' 

myapp_folder$ bundle --verbose 
Fetching git://github.com/my_account/test.git 
fatal: The remote end hung up unexpectedly 
Git error: command `git clone 'git://github.com/my_account/test.git' "/Library/Ruby/Gems/1.8/cache/bundler/git/test-7b1f0bd821d503c9d6d421d89c56850dad44c15a" --bare --no-hardlinks` in directory /Users/.../myapp_forlder has failed. 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:583:in `git' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:652:in `cache' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:550:in `specs' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:356:in `converge_locked_specs' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:345:in `each' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:345:in `converge_locked_specs' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:143:in `resolve' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:90:in `specs' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/definition.rb:85:in `resolve_remotely!' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:43:in `run' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:220:in `install' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start' 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.18/bin/bundle:13 
/usr/bin/bundle:19:in `load' 
/usr/bin/bundle:19 

それはプッシュ/プル/何でも民間のクローンも自己と完璧に動作します。

私のパブリックgithubリポジトリをバンドルすると完全に動作します。

私はまた、いくつかのgitのクローンmy_private_repoを作ってみると、それは私に私のアカウントのパスワードを尋ねるのバンドルのV 1.0.18

を搭載したMac OS上でです。それは正常なのか、それとも私のsshの設定を見て、私はすでにアクセスする権利があるかを見てください。 それはポイントかもしれませんが、私はこの問題でさらに掘る方法を知らない...

答えて

26

プライベートレポに "SSH"または "HTTP" URLを使用してください。例:

# HTTP (I've found this to be more reliable) 
gem 'test', :git => 'https://[email protected]/my_account/test.git' 
# SSH 
gem 'test', :git => '[email protected]:my_account/test.git' 

ただし、それらを推測しないでください。あなたはgithub repoのページに行くことでそれらを得ることができます...上部に3つのオプションがあります。

パスワードを入力するのが普通です。

+0

でこれを追加するには、良いヒント –

+0

はSSH URLは少なくとも局部的に、私のために働いていませんでした。これをCIや他のすべてに取り入れることは楽しいはずです。ありがとう:) –

+0

Macの場合、エラーは私が端末ウィンドウでgit cloneコマンドを実行すると実際のエラーを示したため、奇妙になる可能性があります。 git clone https://github.com/alexdunae/validates_email_format_of.git Xcode/iOSライセンスに同意するには管理者権限が必要です。sudoを使用してrootとして再実行してください。 –

-2

後者、前者が働いていたあなたの〜/ .gitconfig

[url "https://"] 
    insteadOf =git:// 
関連する問題