Signing into rubygems is broken #343

qrush opened this Issue Sep 1, 2011 · 8 comments


None yet
4 participants

qrush commented Sep 1, 2011

% gem owner gemcutter
Enter your credentials.
Don't have an account yet? Create one at
Pushing gem to
Signed in.
Pushing gem to
Access Denied. Please sign up for an account at

% more ~/.gem/credentials                                 

:rubygems_api_key: ! '{"rubygems_api_key":"api key"}'


gorenje commented Sep 1, 2011

is this related to rubygems/rubygems#172 ?

abuiles commented Sep 1, 2011

@qrush I checked the response from and it looks correct, then the problem should be in rubygems and not in gemcutter (as mentioned by @gorenje).


sferik commented Sep 1, 2011

@gorenje Yes, this is the same issue. It was caused by a refactoring made in 5a067cc.

@abuiles In fact, this is a bug in (a.k.a Gemcutter) not the rubygems CLI. The problem is that the behavior is non-deterministic, varying based on the client's Accept header. If you request in your browser, it will (probably) return just your API key, since your browser (probably) includes text/html in your Accept header. However, if you try making the same request via curl (or via rubygems):

curl -u username:password

You'll (probably) get a JSON response.

I'm in the process of reverting 5a067cc now and deploying a hotfix.

abuiles commented Sep 1, 2011

@sferik ha indeed with curl I get json ;( . something I can help with?.

@sferik sferik closed this Sep 1, 2011


sferik commented Sep 1, 2011

@abuiles Thanks for offering to help. I just committed a fix. Working on deploying that to staging now, and then to production.

abuiles commented Sep 1, 2011

@sferik actually sounds like a good idea to start using json points explicitly in rubygems CLI, so this kind of stuff won't happen again.


sferik commented Sep 2, 2011

@abuiles I'd make the case that rubygems should simply use the YAML response format for creating ~/.gem/credentials files. No parsing or mucking required.

It wasn't implemented that way originally is because I only recently added the YAML response format to the API in 0c9fbcb.

abuiles commented Sep 2, 2011

@sferik yeap makes sense, my point was about being explicit about the expect format, call it YAML or JSON.

cmeiklejohn pushed a commit to cmeiklejohn/ that referenced this issue Sep 6, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment