You do not have permission to push

rahul2012's Avatar

rahul2012

13 Mar, 2018 03:15 AM

Dear Sir,
I am suddenly getting this error message on a gem of mine (cetus) that I created and have been pushing for several years.

You do not have permission to push to this gem. Ask an owner to add you with: gem owner cetus --add [email blocked]

I have upgraded to Mac OS Sierra a few months back, don't know if this is related to that. The email id mentioned above is also an email id of mine. I have two accounts on github, a work and personal. I have my system configured for two accounts and it has worked all this while.

Attached is output of gem env command.

Thanks a lot
Rahul Kumar

  1. Support Staff 1 Posted by kerrizor on 04 May, 2018 06:18 PM

    kerrizor's Avatar

    Rahul,

  2. kerrizor closed this discussion on 04 May, 2018 06:18 PM.

  3. rahul2012 re-opened this discussion on 05 May, 2018 04:50 AM

  4. 2 Posted by rahul2012 on 05 May, 2018 04:50 AM

    rahul2012's Avatar

    Hi kerrizor,

    I am aware that this gem's owner is [email blocked] (rkumar). But
    every effort to push this gem as that user is failing with the same error.

    Here is what all I have tried:

    git config user.email '[email blocked]'
    git config user.name 'rkumar'

    gem push pkg/cetus-0.1.16.gem

    Pushing gem to https://rubygems.org...
    You do not have permission to push to this gem. Ask an owner to add you
    with: gem owner cetus --add [email blocked]

    gem push pkg/cetus-0.1.16.gem -k 49d.....
    ERROR: No such API key. Please add it to your configuration (done
    automatically on initial `gem push`).

    I get the same error if I try:
    gem push pkg/cetus-0.1.16.gem -k rkumar

    gem push pkg/cetus-0.1.16.gem -k ~/.gem/credentials.rkumar

    "rake release" gives the same error.

    My .git/config file has user as "rkumar", and email as "oneness.univ....".

    Would really appreciate if you could tell me how to get "rake release" to
    use "rkumar" instead of "kepler".

    Thanks,
    Rahul Kumar

  5. Support Staff 3 Posted by Aditya Prakash on 05 May, 2018 06:46 AM

    Aditya Prakash's Avatar

    Run following and then try gem push:
    curl -u rkumar https://rubygems.org/api/v1/api_key.yaml >
    ~/.gem/credentials; chmod 0600 ~/.gem/credentials

  6. 4 Posted by rahul2012 on 06 May, 2018 03:10 AM

    rahul2012's Avatar

    Thanks, I did run the above and it worked.
    But does this mean that each time I wish to switch the user, I will have to
    replace the credentials file. Somehow earlier this was working without a
    hitch, and the correct credentials file would be picked up.

    Thanks a lot,
    Rahul Kumar

  7. Support Staff 5 Posted by Aditya Prakash on 19 May, 2018 08:02 PM

    Aditya Prakash's Avatar

    But does this mean that each time I wish to switch the user,

    Are sure you switched your rubygems.org user? ~/.gem/credentials holds the key we use to identify you for gem commands.
    EDIT: You can have multiple keys in your ~/.gem/credentials and select them with gem push -k work mygem. Check: https://github.com/rubygems/rubygems.org/issues/152

    Here is what all I have tried: git config user.email '[email blocked]' git config user.name 'rkumar' gem push pkg/cetus-0.1.16.gem

    gem command doesn't any have to do with your git user.
    I would suggest going through these docs[1][2] if you would like to learn more about sign in through command line and gem push.

    [1] https://guides.rubygems.org/publishing/#publishing-to-rubygemsorg

    [2] https://guides.rubygems.org/command-reference/#gem-signin

  8. kerrizor closed this discussion on 12 Aug, 2018 01:12 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac