small medium large xlarge

Back to: All Forums  FXRuby
23 Jan 2008, 15:53
David Anderson (3 posts)

On a Leopardized iMac… looking at the beta book… Trying to get fxruby installed…

The fxRuby from macports didn’t work. The gem install didn’t work. It all got caught up accessing missing libs while the XCode building was going on. A little lib copying and I get a rash of undefined symbols on the build. Just working my way through until I get it right.

Perhaps including a little explanation in the book of what makes up fxRuby under the covers - what has to be there and why - may help to shed some light on the inner workings and why certain issues may occur.

We need a one-click fxruby installer. :)

23 Jan 2008, 20:39
Lyle Johnson (47 posts)

David, I haven’t upgraded to Leopard yet, but I am going to try to get some time on a Leopard box as several people have reported issues installing FXRuby on Leopard. Can you tell me a little more about the manner in which it “didn’t work” on MacPorts? Ditto for the Gem installation.

For the most part, I’m trying to keep more detailed installation instructions, and explanations of things that can go wrong, on the web site (as noted in section 1.1 of the book); but perhaps it would help to have some more detail in the book.

I am considering building a binary Gem of FXRuby for Leopard, one that would be compatible with the built-in Ruby. The problem is that a lot of people (myself included) will not necessarily use that built-in Ruby; they’ll want to try out Ruby 1.9, or a more recent patch level of 1.8.6, or whatever. We’ll have to see what makes the most sense.

24 Jan 2008, 22:24
David Rupp (1 post)

David, take a look at “Lyle’s post”: on building Fox from source, and my “two”: “parter”: on getting the gem going.

25 Jan 2008, 02:15
David Anderson (3 posts)

I’ve got to wait until this weekend to get back into it… working to pay bills is such a pain. :)

I’ll try to reconstruct a blow-by-blow account as I go along.

25 Jan 2008, 16:33
Ludovic Kuty (5 posts)

I succeeded in using fxruby on Leopard.

I installed several things with macports. Among them another copy of ruby :/ Now I have three copies including 1.9.

mac:~ ludo$ port installed The following ports are currently installed: </code> fox @1.6.31_1+darwin_9 (active) fxscintilla @1.71_1 (active) rb-fxruby @1.6.13_0 (active) rb-opengl @0.32c_2 (active) ruby @1.8.6-p110_0+darwin_9+thread_hooks (active) … </code>

But I have to prepend the following line to all fxruby examples to be able to use the right version of ruby (the one installed with macport and all the stuff that comes along): #!/opt/local/bin/ruby

Thus, for example: ` #!/opt/local/bin/ruby require ‘fox16’

include Fox

theApp =

theMainWindow =, “Hello”) theButton =, “Hello, World!”) theButton.connect(SEL_COMMAND) do |sender, selector, data| exit end theApp.create `

I did so many things to make it work that I can’t tell if I forget something or not :)

28 Jan 2008, 18:21
Lyle Johnson (47 posts)

Ludovic, the FXRuby installed via MacPorts (i.e. rb-fxruby) is indeed “paired” with the Ruby installed from MacPorts, the one found under /opt/local. Your other Ruby installations (either the one that came with Leopard, or your installation of Ruby 1.9) aren’t going to be able to see and use the FXRuby from MacPorts, but this isn’t an FXRuby-specific issue. (If you arrange your PATH setting such that /opt/local/bin comes before /usr/bin and /usr/local/bin, you wouldn’t need to prepend that extra line to the FXRuby examples.)

03 Mar 2008, 16:23
Lyle Johnson (47 posts)

Just wanted to post this info here as well. As of the latest update to the ruby port in MacPorts, FXRuby builds properly on Leopard. Read about it “here”:

18 Mar 2008, 06:14
Eric Monti (1 post)

Lyle I just got my copy of the combo. Thanks for this. I’ve been looking long and hard for a capable cross-platform GUI toolkit for ruby and a guide for getting familiar with it quickly.

A note of advice after skimming the installation section. For your final print of the book, I’d highly recommend including both the macports install or David Rupp’s procedure. Personally, I don’t have major objections with using macports, but if I can avoid it, I will. I have several colleagues (with whom I’ll probably be sharing some of the fruits of my FXRuby labors) who would probably pitch a fit at the notion of installing a /usr/local or /opt/local instance of ruby when they could stick with the Apple provided 1.8.6 version that comes with Leopard.

I’d also like to take this opportunity to thank David for his concise post on the installation steps and recommend this as an option for anybody else looking to get up and running quickly with FXRuby and avoiding the macports multiple instance scenario.


19 Mar 2008, 00:53
Lyle Johnson (47 posts)

Eric, the book has already gone to press and so it’s too late to add any additional instructions about building FXRuby using the stuff that ships with Leopard. However, it’s never too late to improve the online installation documentation to include such information.

One of the problems with building everything from scratch is that there are so many dependencies for a comprehensive build of FXRuby. There’s FOX, of course, plus the image support libraries (libjpeg, libtiff and libpng), none of which ship with Leopard. But you’re right that for end users who don’t need all of those development and build tools, we need a more streamlined distribution (similar to the binary gem for Windows).

29 Mar 2008, 01:39
Lyle Johnson (47 posts)

As of the newly released FXRuby 1.6.14, there is now a binary gem for Mac OS X (Leopard). This gem contains everything you need to get started working with FXRuby on OS X, and doesn’t depend on MacPorts or otherwise requiring you to compile anything. Just type:

sudo gem install fxruby</blockquote>

and that should do the trick. If you run into problems, please report them here or, preferably, on the FXRuby users mailing list mentioned in the book.

05 May 2008, 20:16
David Kapp (8 posts)

EDIT If you install fxruby via MacPorts right now, it’ll install a new version of Ruby as well… which would normally be fine, but it seems to break Rails right now (you’ll get the now-infamous “Rails requires RubyGems >= 0.9.4.” error…). So I don’t recommend doing this unless you don’t plan on using Rails. And odds are you do. ;)

Just a little heads up from another Leopard user. I updated MacPorts & Ruby as recommended, and then tried installing FXRuby, but ran into the problem Lyle detailed on his blog (about g++ not actually getting called - see “here”: ) even with the new versions. That said, the old solution that worked for him - just running the install via port a second time worked like a charm. Not sure why, but it did. So if you’re having issues still, you might want to just try running ~~~ sudo port -v install rb-fxruby ~~~ again.

Lyle, I’m liking the book, really excited to dig into it. :)

15 May 2008, 10:51
Tom Malone (3 posts)


I’m having a lot of trouble getting the FXRuby gem to compile on Ubuntu Hardy Heron. I have followed the instructions, installing libfox-1.6-dev, after installing Ruby and RubyGems, but the FXRuby gem just doesn’t compile. I have tried removing and reinstalling Ruby altogether through aptitude (and through Synaptic, the GUI package manager), but still have been unsuccessful.

It says “Cannot find -lxrandr”. I do have libxrandr installed (I checked in Synaptic). Is there some way I need to communicate it’s location to gem? Which file does it need to know about?

Thanks! Tom Malone

15 May 2008, 15:09
Lyle Johnson (47 posts)

Tom, I did a “Google search”: for “hardy heron fxruby” and found “this thread”: from the Ubuntu forums. The solution seems to be installing the “libxrandr-dev” package (i.e. “sudo apt-get install libxrandr-dev”) before attempting to install FXRuby.

Please let me know if this does (or doesn’t) fix the problem. I don’t currently have a Hardy Heron installation to experiment, but can set one up in a VM if necessary.

15 May 2008, 22:16
Tom Malone (3 posts)


Thanks! That was the problem. Now that I have that package installed I’m up and running.


01 Oct 2009, 18:57
NYGeog (5 posts)

I tried that [port sudo port -v install rb-fxruby] thing but I keep getting Warning: No Indexes found have you synced your source indexes?

02 Oct 2009, 13:35
Lyle Johnson (47 posts)

NYGeog, it sounds like your MacPorts installation is broken. What happens if you first type:

sudo port -d selfupdate


and then try again to install FXRuby from MacPorts?

19 May 2011, 19:31
Jon Kern (1 post)

Okay, It’s 2011… where is the best, simplest, concise set of “How To” for getting fxruby running on a Mac?

23 May 2011, 20:54
Lyle Johnson (47 posts)

You must be logged in to comment