rubygems - 尝试添加 ruby gem 源时“没有这样的名称”
问题描述
我有一个作为 gem 存储库的工件服务器。
当我尝试更改 gem 源时,出现错误no such name
gem source -a https://artifactory.example.com/api/gems/gems
Error fetching https://artifactory.example.com/api/gems/gems:
no such name (https://artifactory.example.com/api/gems/specs.4.8.gz)
如果我尝试绕过人工虚拟存储库,并直接指向本地存储库,则会出现错误
gem source -a https://artifactory.example.com/api/gems/gems-local/
Error fetching https://artifactory.example.com/api/gems/gems-local/:
bad response Not Found 404 (https://artifactory.example.com/api/gems/gems-local/specs.4.8.gz)
根据工件文档,尾部斜杠确实很重要。我已经尝试过使用和不使用斜杠的上述示例。所有的结果都是一样的。
/api/gems/gems
/api/gems/gems/
/api/gems/gems-local
/api/gems/gems-local/
我该如何进一步解决这个问题?添加 gem 源的正确方法是什么?
解决方案
要获取更多调试信息,请将--verbose
选项传递给命令行。
gem source -a https://foo.example.com --verbose
该错误no such name
不是真正问题的描述性答案。我在使用错误内部 SSL 证书的工件服务器前面有一个配置错误的 nginx 反向代理。一旦我在 nginx 中修复了证书,我就能够正确连接到 gem 存储库。
推荐阅读
- xamarin - 如何以编程方式获取主题颜色
- angularjs - 使用 angular-translate 的 angular-formly 验证消息翻译
- java - 如何将通用列表映射到另一个通用列表?
- javascript - JSX vs 组件引用作为值类型
- java - 构建jlink后如何检查文件是否存在?
- javascript - js单位换算
- azure - 托管服务身份必须配置为使用身份验证令牌策略
- matplotlib - 使用 matplotlib 时未定义名称“绘图”
- typescript - 如何让 TypeScript 为这些参数推断正确的类型?
- python - Discord bot 无法断开连接 - python 3.8