2011-08-17 35 views
21

Tôi đã có rắc rối để bó đá quý từ các kho riêng git:Bundle: Cài đặt đá quý từ kho github tin

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 

Nó hoạt động hoàn hảo với đẩy/kéo/bất cứ điều gì clone tin nó ngã.

Nó hoạt động hoàn hảo với gói kho lưu trữ github công khai của tôi.

Tôi đang trên Mac OS với bó v 1.0.18

tôi cũng cố gắng để làm cho một số my_private_repo git clone, và nó hỏi tôi mật khẩu tài khoản của tôi. Là nó bình thường hoặc nó nên nhìn vào cấu hình ssh của tôi và nhìn tôi đã có quyền truy cập. Có thể đó là vấn đề, nhưng tôi không biết cách tìm hiểu sâu hơn về vấn đề này ...

Trả lời

26

Sử dụng URL "SSH" hoặc "HTTP" để lưu trữ riêng tư của bạn. Ví dụ:

# 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' 

Tuy nhiên, đừng đoán chúng. Bạn có thể lấy chúng bằng cách vào trang repo github của bạn ... có ba tùy chọn ở trên cùng.

Bạn nên nhập mật khẩu nếu nó yêu cầu.

+0

Cựu làm việc, sau không, tốt tip –

+0

SSH URL làm việc cho tôi, ít nhất là tại địa phương. Nên được vui vẻ để có được điều này làm việc trên CI và mọi thứ khác. Cảm ơn :) –

+0

Trên máy Mac, lỗi có thể là lạ, đối với tôi chạy lệnh git clone trong cửa sổ đầu cuối cho thấy lỗi thực tế. git clone https://github.com/alexdunae/validates_email_format_of.git đồng ý với các giấy phép Xcode/iOS yêu cầu đặc quyền quản trị, xin vui lòng chạy lại như là người chủ qua sudo. –

-2

thêm này trong thư mục ~/.gitconfig

[url "https://"] 
    insteadOf =git:// 
Các vấn đề liên quan