Installing RMagick on Solaris

Posted by Sam

It seems that installing RMagick is a pain on any OS but recently installing on Solaris seemed a bit impossible. Previously we were using ImageMagick 5.2.9 and an older version of RMagick. We've recently switched from Blastwave to OpenCSW to get our Solaris package fix. With that came a new version of ImageMagick and new problems. Turns out ImageMagick from OpenCSW was using compiled using OpenMP but support for that isn't in the current version of GCC that OpenCSW has. Here are the steps I took to install RMagick. There might be a simpler way but this worked for me.

wget http://rubyforge.org/frs/download.php/51093/rmagick-2.9.1.gem
gem unpack rmagick-2.9.1.gem
Change line #139 rmagick-2.9.1/ext/RMagick/extconf.rb to: $CFLAGS = ENV["CFLAGS"].to_s + " -I/opt/csw/include/ImageMagick"
cd rmagick-2.9.1
gem build rmagick.gemspec
gem install rmagick-2.9.1.gem

Tags: ruby rmagick solaris

GZip IIS logs in four lines of ruby

Posted by Sam

I've been running IIS web servers for about 8 years now. I have to say that I'm not a big fan. It's more of a hassle to move and automate, especially compared to Apache. One of the things I haven't taken time to really take care of until now is managing the logs in an automated fashion. I decided it was time to take 5 minutes to handle this repetitive task. So I took a couple of minutes and installed Ruby 1.8.6 on the web servers and wrote the four line script to find and gzip all IIS log files excluding todays. Hopefully you find it useful.

ignore_file = Time.now.strftime 'ex%y%m%d.log'

Dir.glob 'C:/logs/**/*.log' do |f|
  `c:/scripts/gzip.exe -9 #{f}` unless f.include? ignore_file
end

Tags: iis ruby

Compiling Ruby Enterprise Edition on Solaris 10

Posted by Sam

I wanted to try out Phusion's Ruby Enterprise Edition and hopefully Phusion's Passenger. From what I've read I know they are a pretty Linux centric pair of developers so I wasn't surprised at all that their Ruby Enterprise Edition installer didn't actually install on Solaris 10 despite using gnu tools. Fortunately, it was pretty easy to bypass their installer and compile it like I would with MRI. Here's a quick rundown of what I did to get it compiled.

Here's what I did to get Ruby Enterprise Edition compiled on Solaris 10. This assumes you are using gcc from Blastwave. bash-3.00# wget http://rubyforge.org/frs/download.php/38084/ruby-enterprise-1.8.6-20080507.tar.gz
bash-3.00# gtar xvf ruby-enterprise-1.8.6-20080507.tar.gz
bash-3.00# cd ruby-enterprise-1.8.6-20080507/source
bash-3.00# ./configure --with-openssl-dir=/opt/csw --with-readline-dir=/opt/csw \
--with-iconv-dir=/opt/csw --prefix=/opt/rubyenterprise
bash-3.00# make
bash-3.00# make install

That's all there is to it. I wish Phusion wasn't so Linux centric. I'm going to try and get mod_rails or passenger or whatever it's called this week compiled next, but I don't think it's going to go quite so easy.

Tags: ruby