I’ve written a few gems that I’ve released to rubygems using Gemcutter and the source stored on github.
I have issue that I need to create a gem that can’t be open source and also not available to the community, but only to members of my team.
I am aware that I can store gems locally and target them in my Gemfile, however I’d like to be able to do
rake version:bump
rake release
or similar. That would bump the version and push it to my gem server and still keep older gems so that people can install older versions of it.
Seems like it should be fairly simple to do. I’m just missing how to do it
This is fairly simple if you have a server you can host your private gems on. Setup a subdomain, something like
gems.companyname.comand setup a virtual host to host your domain. You’d point that virtual host to a folder like you would any website and setup the gem server from there.Example:
/var/www/gemserverwould be the root directory. Lastly all you’d need to do is add a new source to yourGemfileSo anyone that knows about your custom domain can get access to the gems. The only pain is every time you rebuild your gem you need to run the
generate_indexcommand again after you upload your gem to the gems folder.