ruby (Pete's notes)

See http://www.clarkware.com/cgi/blosxom/Software/Ruby or http://www.clarkware.com/cgi/blosxom/2005/03/18#RLT1 for Mike Clark's primer on how to build a library of unit tests while learning a language.

Mac OS X

I followed http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx to install Ruby. Later, when I upgraded to Leopard, I think the upgrade installed Ruby again. Then I installed Rails.

Mac AppleScript and Ruby

I learned that rb_appscript is a cool way to do AppleScript-like things from Ruby. It installs the "osax" module, which I use it in PetesHelp.rb

To install it, I did

sudo gem install rb-appscript

Then I had to add this to my .bashrc:

# Set up Ruby
#
if [[ -d /Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1 ]]; then
   export RUBYLIB=/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1:$RUBYLIB
   export RUBYLIB=/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/src/lib:$RUBYLIB
fi

Docs are available at file:///Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/doc/index.html

Linux

I removed the ruby 1.6.7-2 that came with my Red Hat 7.3 as follows:
rpm -e ruby-devel-1.6.7-2 \
ruby-libs-1.6.7-2 \
ruby-1.6.7-2 \
ruby-tcltk-1.6.7-2 \
ruby-docs-1.6.7-2 \
eruby-libs-0.9.7-1 \
eruby-libs-0.9.7-1 \
eruby-0.9.7-1 \
irb-1.6.7-2 \
eruby-devel-0.9.7-1
Then I installed ruby 1.8.0 as follows: I web'd to the Ruby website and get the tarball, then
<as root>
cd /usr/src
tar xf ruby-1.8.0.tar
rm ruby-1.8.0.tar
cd ruby-1.8.0
./configure
make
make test
make install
The "make install" gave several errors but seemed to work.
Pete Siemsen