[英]Uploading packages to Gemfury using RubyGems CLI silently failing
I am trying to upload a package to Gemfury using RubyGems as described here .我正在尝试使用 RubyGems 将package上传到 Gemfury,如此处所述。 The command below is failing without error messages:以下命令失败且没有错误消息:
$ 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
Enabling debug
and backtrace
reveals an error which doesn't seem related with the upload per se:启用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
It turns out it was an URL problem...原来这是一个 URL 问题......
Enabling verbose
revealed an extra /
in the URL, which seemed to be causing the issue:启用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
Using https://push.fury.io/dlresende
instead of https://push.fury.io/dlresende/
(without the /
in the end, as opposed to what is described in the docs ) fixed the issue:使用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.