RSS
3 Jun 2007

gem_server is A Real RubyGems Server!

Author: ceefour | Filed under: Beginner, Opinions, Praises, Rails, Ruby, Tips

I just realized this… Thanks to Peter Cooper. :-)

Suppose you already have the gem files on your local folder, and you want to install these gems and all of their dependencies, which you also already have. The usual way would be to gem install filename.gem each of these manually, taking extra care of dependencies… Probably okay if you just want to install one or two gems, but this gets really painful for more gems (even just Rails).

Enter: the omnipotent gem_server

First, just copy all of your gem files into the RubyGems cache folder. This is usually /usr/lib/ruby/gems/1.8/cache on Linux/Ubuntu systems.

Run gem_server from the command line: gem_server

You should know by now that at this point you can point your web browser to http://localhost:8808/ to view documentation for your installed RubyGems.

Then, observe:

ceefour@ojalanow:~$ sudo gem install hobo --source http://localhost:8808
127.0.0.1 - - [01/Jun/2007:20:20:11 WIT] "HEAD /yaml HTTP/1.1" 200 0- -> /yaml
Install required dependency rails? [Yn]  y
Successfully installed hobo-0.5.3
Successfully installed rails-1.2.3

Amazing, ain’t it?

Why didn’t I know that 15 years ago? *duh* ;-)

Technorati Tags:

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

blog comments powered by Disqus