Switching between accounts in my local computer
I have two different accounts on rubygems (one for my personal projects, one for my company work). I must "switch" from one to the other, otherwise I get a "you are not authorized to push" error when trying to push a gem.
It's been a long time since I pushed a gem for my company and I've forgotten what I had to do in order to "switch contexts" in my computer.
I've spent one hour looking for information on how to switch, but I could not find information on it.
What commands / config files do I have to use to tell my computer "I am now user xxx on rubygems, let me push"?
Thanks a lot
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Nick Quaranto on 29 Jul, 2011 03:23 PM
If you upgrade rubygems, there is a new
-koption that lets you specify which key to use. Just edit~/.gem/credentialsand drop in your api key in YAML (follow the example there for another entry)gem push --help Usage: gem push GEM [options] Options: -k, --key KEYNAME Use the given API key from ~/.gem/credentials3 Posted by kikito on 07 Aug, 2011 01:48 PM
Thanks! I was finally able to push the gems.
One question though: it's not possible to have both keys simultaneously active, is it?
For now, I have both on my credentials file and comment/uncomment the keys as I need them.
Regards!
Support Staff 4 Posted by Gabriel Horner on 07 Aug, 2011 07:53 PM
It's not possible to have both active. But as Nick pointed out, you can switch between keys with -k with recent versions of rubygems. Feel free to reopen if you have more questions.
Gabriel Horner closed this discussion on 07 Aug, 2011 07:53 PM.