Ruby GD2 on Windows
Update: Thanks to an anonymous comment below I found a fix. If you download the package from http://www.boutell.com/gd/http/gdwin32.zip and place bgd.dll into your system32 folder, it works like a dream.
Just thought I would post something about this since I banged my head against the wall for hours on this one. I am working on a site that I need a drawing library for. Since I am vaguely familiar with php-gd, I almost got stuck with php on this project until I saw that there is a ruby gem that wraps libgd2, so I stuck with rails on this one (horray). My laptop (running Ubuntu Hardy) was already set up for rails development, so I just did a gem install gd2 and I was ready to go. A couple hours into the project, I was at home where I could use my dual monitor windoze rig (I am a linux zealot, but I am forced to use windows for my main machine since no decent online backup services support linux).
Much to my dismay, I did a ‘gem install gd2′ on windows (which worked), but it complained about not being able to find bgd.dll… so the hunt for bgd.dll began. I ended up finding a compiled version at libgd.org and copied the dll to my system32 folder. Then I tried to start up mongrel again and got ‘unknown symbol gdFontGetLarge@0a’. I looked alllll over online, ended up trying to compile my own (with both cygwin and mingw with cmake) and had no luck. It turns out that this is happening because freetype support is apparently not compiled into bgd.dll (which I can’t do without).
Finally as a last resort, I installed andLinux and shared my windows filesystem with andLinux. That way I have a full copy of ubuntu running on my wxp box. From there I installed ruby, gems, rails, etc… and just run my server on the linux box pointing to the files on the windows box. It is UGLY and sometimes crashes, but at least I don’t have to check code into the svn repo just to test.
Just thought I would clear it up for anybody else undertaking this painful journey. It’s probably possible to get it working, but it is beyond me. If you have found a way to get this working, PLEASE tell me, I will update the post (and give you credit of course). Just another reason to say no to windoze.
June 16th, 2008 at 1:55 am
This is the #1 result on google for ‘ruby gd2 windows’. Again, if you are here and have figured it out, please point me to where you found the solution!
August 12th, 2008 at 9:05 am
Try this one
http://www.boutell.com/gd/http/gdwin32.zip
August 12th, 2008 at 4:22 pm
I think I have already tried that one. My windoze box blew up, so I will give it a shot when it gets fixed. Thanks.
September 12th, 2008 at 4:30 am
The boutell link contains freetype support.
September 12th, 2008 at 1:16 pm
Thanks anonymous, that did the trick.