While reading one of Daniel Hoelbling‘s great posts I noticed a strong warning he makes saying: The GAC is your enemy!
I fully understand his point, that its a PITA at the least to have to hunt down dependencies that others have installed in their GAC. But I also can’t help thinking that installing something to the GAC is very much like adding a Gem in Ruby.
So why is this lavish disregard for what other team members may (or may not) have installed on their machines acceptable in Ruby world?
In Ruby if I have a missing Gem reference then all I need to is pop open a command line and type “Gem install xxxx” and hey presto I have the dependency installed. Couple this with the fact that Rails brings some Rake tasks to the table to allow all a projects missing Gems to be installed at once by executing “rake gems:install”.
Now don’g get me wrong, I’m fully aware that there are many other reasons not to install to the GAC, but I don’t see why Ruby manages to side step a lot of these issues. This is generally a question to anyone reading this post, what does the Gem framework do to counter versioning issues and updates to shared libraries?
HornGet: Apt-Get for .NET
A quick search on the web leads me to HornGet a great project that allows “apt-get” type scenario for .NET applications via a command like “horn -install:rhino“. Horn will not do any GAC installation, instead it will build the latest versions of your libs and add them to a specified location (defaults to user profile directory).
This is a great project as far as I am concerned, as just trying to hunt down the latest versions of common 3rd party libraries can be painful. I think that .Less is defiantly going to be added to horn.
Well, Horn may be the way to go.
The problem with the GAC is not so much the verisoning thing but that there is nobody responsible for managing it.
You put stuff in there and it starts to pile up and become more and more like the jungle.
Nobody handles updates, nobody handles versioning issues.
How exactly Gems make the Versioning issues go away I don’t know, but at least it keeps track of what’s there and what’s gone.
Btw.. horn has just launched a site where you can download precompiled packages of the decriptors. So if you need Rhino.Tools you just download it from their site instead of going through the hassle of installing Horn and then running a 30+ minute install
greetings Daniel
The site I was referring to is btw: http://www.hornget.net
They launched a few days ago I think. Also the descriptors are kept on GitHub so it’s easier for OSS projects to add new descriptors as needed.
You can prevent problems with updates to Gems you’re using in your Rails projects by passing a version option to config.gem like so
config.gem ‘mislav-will_paginate’, :version => ‘2.3.8’, :lib => ‘will_paginate’, :source => ‘http://gems.github.com’
Rubygems allows you to have multiple versions of any gem installed together.
As Rails itself is a gem, by specifying a Rails version in your project you can have multiple rails versions installed and multiple apps running on different Rails versions simultaneously.