首页 > 解决方案 > 尝试添加 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 源的正确方法是什么?

标签: rubygemsartifactory

解决方案


要获取更多调试信息,请将--verbose选项传递给命令行。

gem source -a https://foo.example.com --verbose

该错误no such name不是真正问题的描述性答案。我在使用错误内部 SSL 证书的工件服务器前面有一个配置错误的 nginx 反向代理。一旦我在 nginx 中修复了证书,我就能够正确连接到 gem 存储库。


推荐阅读