Notes on Life, ‘Puters and Hawaii

Compiling Ruby 1.8.6, Rails 2.0 and Rmagick on Mac OS X Leopord

Ruby and Rails comes on Leopard. Yahoo! That’s great. Oh wait, it’s a slightly out of date Ruby 1.8.6 and Rails 1.2.3. Hmm It’s owned by root too and you might fsck it up walking around as sudo all the time. So… Here you go. Make sure you have XCode 3.0 installed and then open a terminal and paste in the following:

cat >> $HOME/.profile << \EOF
export PATH=/usr/local/bin:$PATH
EOF
source $HOME/.profile
cd /tmp

curl -O http://mirrors.ibiblio.org/pub/mirrors/ruby/1.8/ruby-1.8.6-p111.tar.gz
tar xvzf ruby-1.8.6-p111.tar.gz
cd ruby-1.8.6-p111
# README: http://www.ruby-forum.com/topic/129201
curl http://chopine.be/lrz/ruby-osx-patches/dot-darwin.diff | patch -p0
curl http://chopine.be/lrz/ruby-osx-patches/etc-irbrc.diff | patch -p0
curl http://chopine.be/lrz/ruby-osx-patches/ignore-gsetcontext.diff | patch -p0
curl http://chopine.be/lrz/ruby-osx-patches/md5_sha1_commoncrypto.diff | patch -p0
curl http://chopine.be/lrz/ruby-osx-patches/use-dyld.diff | patch -p0
curl http://chopine.be/lrz/ruby-osx-patches/use-setreugid.diff | patch -p0
curl http://chopine.be/lrz/ruby-osx-patches/words-bigendian-from-arch.diff | patch -p0
./configure --enable-pthread --enable-shared
make
make install
cd ..

curl -O http://files.rubyforge.mmmultiworks.com/rubygems/rubygems-1.0.1.tgz
tar xzvf rubygems-1.0.1.tgz
cd rubygems-1.0.1
sudo /usr/local/bin/ruby setup.rb
sudo gem update --system
cd ..

curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.24.tar.gz
tar xvzf libpng-1.2.24.tar.gz
cd libpng-1.2.24
./configure
make
sudo make install
cd ..

curl -O http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar xvzf jpegsrc.v6b.tar.gz
cd jpeg-6b
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.5
./configure --enable-shared
make
sudo make install
cd ..

curl -O ftp://ftp.remotesensing.org/libtiff/tiff-3.8.2.tar.gz
tar xvzf tiff-3.8.2.tar.gz
cd tiff-3.8.2
./configure
make
sudo make install
cd ..

curl -O http://www.littlecms.com/lcms-1.17.tar.gz
tar xzvf lcms-1.17.tar.gz
cd lcms-1.17
./configure
make
sudo make install
cd ..

curl -O http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz
tar xvzf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure
make
sudo make install
cd ..

curl -O http://jaist.dl.sourceforge.net/sourceforge/wvware/libwmf-0.2.8.4.tar.gz
tar xzvf libwmf-0.2.8.4.tar.gz
cd libwmf-0.2.8.4
./configure
make
sudo make install
cd ..

curl -O http://ufpr.dl.sourceforge.net/sourceforge/ghostscript\
/ghostscript-8.60.tar.gz
tar zxvf ghostscript-8.60.tar.gz
cd ghostscript-8.60
./configure  --disable-cups
make
sudo make install
cd ..

curl -O http://ufpr.dl.sourceforge.net/sourceforge/ghostscript\
/ghostscript-fonts-std-8.11.tar.gz
tar zxvf ghostscript-fonts-std-8.11.tar.gz
sudo chown -R root:wheel fonts
sudo mv fonts /usr/local/share/ghostscript

curl -O ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.3.6-10.tar.gz
tar xvzf ImageMagick-6.3.6-10.tar.gz
cd ImageMagick-6.3.6
export CPPFLAGS=-I$HOME/include
export LDFLAGS=-L$HOME/lib
./configure --disable-static --with-modules --without-perl \
--without-magick-plus-plus --with-quantum-depth=8
make
sudo make install
cd ..

# And install the gems
sudo /usr/local/bin/gem install rails capistrano sqlite3-ruby rmagick ruby-debug-ide

2 Responses to “Compiling Ruby 1.8.6, Rails 2.0 and Rmagick on Mac OS X Leopord”

  1. [...] Compiling Ruby 1.8.6, Rails 2.0 and Rmagick on Mac OS X Leopord (tags: ruby rails mac sysadmin) [...]

  2. Nice post. Gotta give it a shot. Just what I was looking for. Didn’t want to use port.