簡體   English   中英

使用 RubyGems CLI 將包上傳到 Gemfury 靜默失敗

[英]Uploading packages to Gemfury using RubyGems CLI silently failing

我正在嘗試使用 RubyGems 將package上傳到 Gemfury,如此處所述。 以下命令失敗且沒有錯誤消息:

$ gem push fizzbuzz-0.1.8.gem --key fury_push_token --host https://push.fury.io/dlresende/
Pushing gem to https://push.fury.io/dlresende/...

$ echo $?
1

啟用debugbacktrace會顯示一個似乎與上傳本身無關的錯誤:

$ gem push fizzbuzz-0.1.8.gem --key fury_push_token --host https://push.fury.io/dlresende/ --debug --backtrace
NOTE:  Debugging mode prints all exceptions even when rescued
Exception `Errno::EEXIST' at /Users/dlresende/.rbenv/versions/2.7.1/lib/ruby/2.7.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /Users/dlresende/.gem/specs/rubygems.org%443
Pushing gem to https://push.fury.io/dlresende/...

$ echo $?
1

原來這是一個 URL 問題......

啟用verbose會在 URL 中顯示一個額外的/ ,這似乎是導致問題的原因:

$ gem push fizzbuzz-0.1.8.gem --key fury_push_token --host https://push.fury.io/dlresende/ --debug --backtrace --verbose
NOTE:  Debugging mode prints all exceptions even when rescued
Exception `Errno::EEXIST' at /Users/dlresende/.rbenv/versions/2.7.1/lib/ruby/2.7.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /Users/dlresende/.gem/specs/rubygems.org%443
GET https://rubygems.org/latest_specs.4.8.gz
304 Not Modified
Pushing gem to https://push.fury.io/dlresende/...
POST https://push.fury.io/dlresende//api/v1/gems
301 Moved Permanently

$ echo $?
1

使用https://push.fury.io/dlresende而不是https://push.fury.io/dlresende/ (最后沒有/ ,與文檔中描述的相反)解決了這個問題:

$ gem push fizzbuzz-0.1.8.gem --key fury_push_token --host https://push.fury.io/dlresende --debug --backtrace --verbose
NOTE:  Debugging mode prints all exceptions even when rescued
Exception `Errno::EEXIST' at /Users/dlresende/.rbenv/versions/2.7.1/lib/ruby/2.7.0/fileutils.rb:250 - File exists @ dir_s_mkdir - /Users/dlresende/.gem/specs/rubygems.org%443
GET https://rubygems.org/latest_specs.4.8.gz
304 Not Modified
Pushing gem to https://push.fury.io/dlresende...
POST https://push.fury.io/dlresende/api/v1/gems
200 OK
~~> Processing package upload
    Uploading            ... ok
$ echo $?
0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM