Wednesday, December 26, 2007

The limitations of Apple's Ruby Distribution

The Ruby 1.8 included with Apple's Leopard is a great way to get
started in Ruby and Rails programming with no installation effort.
They did a very nice job, and you can use RubyGems to update Rails and
other gems, and even clean up gems that Apple has included as they
become obsolete.

However, once you get to a certain depth of involvement in Ruby, you
will probably want to use your own installation(s) of Ruby and
override the version that Apple provides.

Among the reasons:

* Apple updates reinstall old gems. For example, Security Update
2007-009 v1.1 re-installed updated versions of Rails 1.2 that I had
already removed.

It usually isn't that much of a problem because you can "clean" them
again.

I've updated RubyGems to 1.0.1, and I'm not sure what would happen if
Apple updated the 0.9.5 version that was included with the Leopard
distribution.

(Since RubyGems is updated using: gem update --system )

Once I get into serious development, I'd rather have control over when
the language, RubyGems, gems, etc. are updated. I hold all of this
stable while I change my code so I know where to look when something
breaks. The Apple Ruby updates were bundled with other important
security updates, so you have to install them if you want to keep the
other things secure.

* Until RubyGems 1.0.1, updating RubyGems would break Apple's two-
directory Gem setup.

* I don't like mixing third party gem executables with the Apple
supplied executables in /usr/bin. They should go in /usr/local/bin.
Or if using MacPorts, /opt/local/bin.  Etc.

* The now released Ruby 1.9, will require a separate installation.
It's not ready for production use, but gem authors and Rails core
contributors will want to have this early version for testing.

As 1.9 and the gems (including Rails) that use it reach production
quality, I'll want to install it to make sure my own code works.

Apple will probably not be in a hurry to offer 1.9 as a package. I
can't fault them for that, they should offer stable and well tested
distributions and let early adopters compile their own.

For now, I'm happy to use Apple's pre-installed Ruby (and I'm glad you
can count on a certain level of Ruby and a set of gems for scripting,
too.)

But, it won't be long before I'm back to compiling my own.

0 comments: