9

I want to build a rubygems mirror accesible for some servers at work (that don't have Internet access), so I started like everybody seems to do:

 $ cat gemmirror.config 
 ---
 - from: http://gems.rubyforge.org
 to: /data/rubygems/mirror

 $ gem mirror --config-file=gemmirror.config

The mirror starts syncing well. OK. But wait, it downloads the whole content of http://gems.rubyforge.org! I mean all the existing versions of every single gem. Wow. After a couple of hours I'm still downloading the gems that begin with the letter "L" ...

Not to mention the disk-space the mirror is going to take.

Now my question: is there a way to setup a "mini" rubygems server, like CPAN::Mini allows for Perl: such a mirror would contain only the latest version of every gems. This is in 99.9% of the cases what people want, I guess (at least this would be perfectly good enough for me there).

I've googled a lot and sadly, I cannot find any reference to that.

If someone can point me to the way to do that, I'd appreciate very much.

Thanks!

sukria
  • 548
  • 2
  • 10

1 Answers1

1

Not really what you are asking for, but perhaps one way to tackle this, is to setup a caching http proxy that will cache the gems as they are requested, which should subsequent requests hit the cache.

Something like squid should do the job.

Then each client configures the gem proxy to use squid, so all gem downloads go through it and hopefully are in the cache 99% of the time...

Although if you use bundler, seems it has issues with the proxy settings :(

Community
  • 1
  • 1
Chris Kimpton
  • 5,546
  • 6
  • 45
  • 72