Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby - hosting private gems

By any chance, is there any place it's possible to host private ruby gems? So I could allow it to be pulled only for specific places by using public key or something like that?

Thanks

like image 385
zanona Avatar asked Aug 03 '10 12:08

zanona


People also ask

What is a gem server?

RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.

Where are RubyGems hosted?

Our infrastructure is currently hosted on AWS. Some insights into the technical aspects of the site: It's 100% Ruby. The main site is a Rails application. Gems are hosted on Amazon S3, served by Fastly, and the time between publishing a new gem and having it ready for installation is usually just a few seconds.

What is Ruby gem FFI?

Ruby-FFI is a ruby extension for programmatically loading dynamic libraries, binding functions within them, and calling those functions from Ruby code. Moreover, a Ruby-FFI extension works without changes on Ruby and JRuby.


3 Answers

There is a few options for you...

GEM SERVER

Install the gem on any server you want to distribute it from. Then run gem server on the machine. This will start up a small gem server that can be queried by anyone. Then just add the new gem source to the client machines. gem sources -a <server>.

  • Pros: Extremely easy to setup. Can be launched on any port.
  • Cons: Doesn't offer key based authentication.

GITOSIS

Setup a gitosis server and store the gem source code on there. Then just pull from the repo and build the gem when you need to update it. Yes it is an extra couple of steps to build and install the gem, however you will get key based authentication for better security.

  • Pros: Offers key based authentication
  • Cons: Have to pull the source, build, then install the gem on each update. You also have to actually setup the gitosis server.

GITHUB

Exact same thing as gitosis, but you have to pay to make it private. This requires no setup if you can afford it.

  • Pros: Offers key based authentication
  • Cons: Have to pull the source, build, then install the gem on each update. Costs a little money.

Unfortunately, none of the major gem services do exactly what you need. Github stopped building gems, and RubyGems doesn't offer any private gem hosting. Hopefully one of the tools above will work well enough for you. Personally I would just go with the gem server option, then lock the machine down by IP, or some other access restriction. I know its not perfect, but it works and is quick/easy to setup.

like image 53
quest Avatar answered Sep 29 '22 04:09

quest


Check out Gem in a Box.

like image 21
madh Avatar answered Sep 29 '22 05:09

madh


Take a look at Gemfury if you prefer a cloud solution.

Disclaimer: I work on this

like image 32
Michael Avatar answered Sep 29 '22 06:09

Michael