繁体   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