Gem server
From WhyNotWiki
See also: http://wiki.qualitysmith.com/Gem_server
Contents |
[edit] gem_server (Webrick-based)
See http://rubygems.org/read/chapter/18#page80
[edit] Why have a gem_server?
- For documentation:
- shows all install gems -- much prettier than
gem list - shows dependencies
- shows rdoc if available
- shows all install gems -- much prettier than
[edit] How to try it out
server.host> gem_server
And then just go to http://server.host:8808/ (or whatever host you're on)
How to use it to distribute gems:
server.host> gem_server
client.host> sudo gem install gem_name --remote --source server.host:8808 Attempting remote installation of 'gem_name' Updating Gem source index for: http://server.hostname:8808 Successfully installed gem_name-0.0.1 Installing RDoc documentation for gem_name-0.0.1...
Back on server.host you will see the request (from Webrick):
192.168.254.33 - - [12/Feb/2007:10:13:58 PST] "HEAD /yaml HTTP/1.1" 200 0 - -> /yaml 192.168.254.33 - - [12/Feb/2007:10:14:01 PST] "GET /gems/ruby-subversion-0.0.1.gem HTTP/1.1" 200 10240 - -> /gems/ruby-subversion-0.0.1.gem
[edit] Anodyne
Anodyne » Blog Archive » Managing a gem_server in a better way (http://www.anodyne.ca/2006/09/08/managing-a-gem_server-in-a-better-way/).
I needed a way to control my gem_server in a sensible way, and background it properly, so here’s a quick pinch from rails’ reaper.rb
Looks kinda neat, but it's a bit of a hack (copying and pasting from reaper.rb??) and their code wasn't indented properly, so I didn't try it...
[edit] How to create a real gem server -- to be used instead of RubyForge
See http://rubygems.org/read/chapter/18#page80 "How do I run a gem server like rubyforge?"
[edit] Setting up the server
http://rambleon.org/2007/02/13/creating-your-own-gem-server/
I’ve been hand updating gems for too long on my servers, but I have been hesitant to do anything more automated as long as my systems were updating against http://gems.rubyforge.org. RubyForge has been down more than once when I really needed to update something, and I don’t want to create an automated dependency on a third-party service.
So before I automate things, I needed a way to point to my own gem server. Which thankfully, it turns out, that it’s not all that hard to do so (it’s harder than it has to be, and man oh man is the gem cache a pain in the rear). [...]
1. You need a web server. (yes I know you can run
gem_server, but get a real one). You are on your own for that one. You also need a rubygems install on that box. You are also on your own for bootstrapping rubygems on that box and any other ones....
[edit] Pointing your systems to your own server
http://rambleon.org/2007/02/13/creating-your-own-gem-server/
Setting up the server is the easy part. The harder part is pointing all your boxes to your own server. And only your own server. You’d think that one neat thing about the 0.9.2 rubygems release is that it includes a “gem sources” command to theoretically add and remove gem sources that your boxes would look at, but you’d be wrong. Because you can’t get rid of the base source of http://gems.rubyforge.org without modifying the sources gem or the sources distribution on your own box. You can theoretically modify [lib/ruby]/gems/1.8/gems/sources-0.0.1/lib/sources.rb and change [...]
However, that customization is likely going to get blown away the next time you update rubygems with a gem update --system - because the sources gem is built by the rubygems update. So what do you do? Build your own gem update.
...
Voila! You just managed to point your server to your own gem server! Install away.
It’s good to keep one box pointed to http://gems.rubyforge.org - and take advantage of the new “gem outdated” command to keep track of changes in your installed gems that have been deployed to rubyforge.
