[英]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
啟用debug
和backtrace
會顯示一個似乎與上傳本身無關的錯誤:
$ 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.