# Ruby-gnome2 on a mac

**URL:** <https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478>\
**Category:** Ruby-Gnome 2\
**Created:** [November 30, 2008, 11:46am UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478 "2008-11-30T11:46:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [November 30, 2008, 11:46am UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/1 "2008-11-30T11:46:32Z")

</div>

Howdy,

Just thought I’d give a report on trying ruby-gnome2 on a new macbook.

Prerequisites:

- X Code 3.0+ (I used 3.0 as I’m having a problem installing the latest  
3.1.2)
- XQuartz
- MacPorts

Using MacPorts, install: gawk (or nawk), python25, python\_select (then  
use it to select python25), ruby, rb-rubygem, vte, librsvg,  
gtksourceview, gtksourceview2, libgtkhtml, gtkglext, libgnomeui

Could not install:

- poppler (unable to download openjpeg)
- gtkmozembed (not in macports)
- panel-applet (not in macports)
- gstreamer (installed but needs gstreamer-plugins-base which is not in  
macports)
- goocanvas-0.9 (failed to compile)

Downloaded and installed ruby-gnome2-all-0.18.1

I quickly tried one of my mid sized rgnome2 (strictly gtk2) apps and had  
two observations:

1. there appears to be a font metrics problem where about twice the  
vertical space is allocated than is necessary. The app uses default  
fonts.

2. after minimizing the app then restoring it, the display widgets are  
not drawn. Basically a blank window with white rectangles where Entry  
widgets should be.

Have fun,  
Roy

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [November 30, 2008, 11:32pm UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/2 "2008-11-30T23:32:32Z")

</div>

Hi,

You might want to try out the native GTK+ port to Mac OS X instead.  
This will give you an environment without X (or Macports).

1. Build native GTK+ according to  
[http://developer.imendio.com/projects/gtk-macosx/](http://developer.imendio.com/projects/gtk-macosx/)

(remember to run ‘jhbuild shell’)

1. Build ruby in the same prefix ($JHBUILD\_PREFIX)

2. Build ruby-gnome2 in this environment

Cheers,  
Micke

30 nov 2008 kl. 11.46 skrev Roy W.:

> macports)  
> fonts.
> 
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

–  
Mikael H.  
Imendio AB - Expert solutions in GTK+

> **[Tinybird Interactive (.se)](https://tinybird.se)**
>
> Tinybird Interactive - creating fun, useful, and inspiring apps for iPhone, iPad, and Mac.

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [December 2, 2008, 2:18am UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/3 "2008-12-02T02:18:43Z")

</div>

Mikael H. wrote:

> Hi,
> 
> You might want to try out the native GTK+ port to Mac OS X instead.  
> This will give you an environment without X (or Macports).

Thank you. I just gave it a try and hit a major problem with signal  
catching. Here’s a little demo:

#!/usr/bin/env ruby

require “gtk2”

Gtk.init  
window = Gtk::Window.new  
window.signal\_connect(‘destroy’) {Gtk.main\_quit}  
entry = Gtk::Entry.new  
entry.signal\_connect(‘changed’) {|widget, event| puts “#{widget.name}  
changed”}  
entry.text = ‘Howdy’  
frame = Gtk::Frame.new(‘Content Frame’)  
frame.add entry  
window.add frame  
window.show\_all  
Gtk.main

And here’s the output:

roy-wrights-macbook:gtk-demo royw$ jhbuild shell  
Prefix: /Users/royw/gtk/inst  
Entered jhbuild shell, type ‘exit’ to return.  
bash-3.2$ ./demo2.rb

\*\* ERROR \*\*: Please call rbgutil\_start\_callback\_dispatch\_thread() to  
dispatch a callback from non-ruby thread before callbacks are requested  
from non-ruby thread.  
aborting…  
Trace/BPT trap

Now if you reverse the entry.text and entry.signal\_connect lines in the  
above example, the window appears but will have the same crash if you  
try to change the value in the entry widget or if you close the  
application.

Any ideas?

Thank you,  
Roy

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [December 2, 2008, 8:04am UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/4 "2008-12-02T08:04:37Z")

</div>

Hi,

That sounds odd, that code runs fine here but I don’t have the very  
latest version of ruby-gnome2. Did you end up with the same version of  
the bindings as you were using in your Macports environment?

// Micke

2 dec 2008 kl. 02.18 skrev Roy W.:

> ## #!/usr/bin/env ruby frame = Gtk::Frame.new(‘Content Frame’) bash-3.2$ ./demo2.rb above example, the window appears but will have the same crash if you
> 
> [https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)  
> –  
> Mikael H.  
> Imendio AB - Expert solutions in GTK+  
> [http://www.imendio.com](http://www.imendio.com)

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [December 2, 2008, 9:05am UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/5 "2008-12-02T09:05:38Z")

</div>

Mikael H. wrote:

> That sounds odd, that code runs fine here but I don’t have the very  
> latest version of ruby-gnome2. Did you end up with the same version of  
> the bindings as you were using in your Macports environment?

Yes with one exception, used python25-apple instead of the macports  
python25.

ruby-1.8.7-p72  
ruby-gnome2-all-0.18.1

Here’s the tail of configuring ruby-gnome:

Target libraries: glib, gdkpixbuf, pango, atk, gtk  
Ignored libraries: bonobo, bonoboui, gconf, gnome, gnomecanvas,  
gnomeprint, gnomeprintui, gnomevfs, goocanvas, gstreamer, gtkglext,  
gtkhtml2, gtkmozembed, gtksourceview, gtksourceview2, libart, libglade,  
panel-applet, poppler, rsvg, vte

I think I’ll try to upgrade to XCode 3.1.2 again then try rebuilding the  
jhbuild environment.

Thank you.

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [May 8, 2009, 6:23pm UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/6 "2009-05-08T18:23:35Z")

</div>

Hi, do you know if a ruby-gnome2 dmg is avalaible?

I installed Mono and Tomboy dmg and they run fine and without Xcode.

---

<div class="post-metadata">

**Author:** ![royw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@royw](https://www.ruby-forum.com/u/royw)\
**Post date:** [December 3, 2008, 12:29am UTC](https://www.ruby-forum.com/t/ruby-gnome2-on-a-mac/154478/7 "2008-12-03T00:29:33Z")

</div>

Roy W. wrote:

> I think I’ll try to upgrade to XCode 3.1.2 again then try rebuilding the  
> jhbuild environment.

After the rebuild (xcode 3.1.2, jhbuild, ruby, ruby-gnome2), the above  
demo ran fine.

Thank you,  
Roy
