spuder
spuder

Reputation: 18427

`no such name` when attempting to add ruby gem source

I have an artifactory server that is acting as a gem repository.

When I try and change the gem sources, I get error 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)

If I try and bypass the artifactory virtual repository, and point straight at the local repository I get error

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)

According to the artifactory documentation, the trailing slash does matter. I've tried the above examples with and without trailing slashes. All with the same result.

/api/gems/gems
/api/gems/gems/
/api/gems/gems-local
/api/gems/gems-local/

How can I further troubleshoot this? What is the proper way to add a gem source?

Upvotes: 1

Views: 369

Answers (2)

Morten Holmgaard
Morten Holmgaard

Reputation: 7806

I just had this issue because I was on a VPN connection - it worked again after disconnecting from the VPN.

Upvotes: -1

spuder
spuder

Reputation: 18427

To get more information for debugging, pass the --verbose option to the command line.

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

The error no such name is not a descriptive answer for the true problem. I had a misconfigured nginx reverse proxy infront of the artifactory server that was using the wrong internal SSL certificate. As soon as I fixed the certificate in nginx, I was able to connect to the gem repository properly.

Upvotes: 3

Related Questions