# Compile ruby with the rubyinstaller

**URL:** <https://www.ruby-forum.com/t/compile-ruby-with-the-rubyinstaller/173229>\
**Category:** Ruby-Gnome 2\
**Created:** [August 5, 2009, 10:52am UTC](https://www.ruby-forum.com/t/compile-ruby-with-the-rubyinstaller/173229 "2009-08-05T10:52:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinwoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df705f/32.png) [@shinwoo](https://www.ruby-forum.com/u/shinwoo)\
**Post date:** [August 5, 2009, 10:52am UTC](https://www.ruby-forum.com/t/compile-ruby-with-the-rubyinstaller/173229/1 "2009-08-05T10:52:28Z")

</div>

I saw the latest benchmark on rubyinstaller(mingw) which is much faster  
than normal mswin32 ruby. So, I decided to try it with ruby-gnome2.

I only compile the ruby-gtk2-0.19.1 and it works quite well with some  
glitch. Mostly is the Makefile doesn’t have proper include path or  
library link path.

The only problem that seems to be a bug is the gtk Makefile at its LIBS:  
LIBS = $(LIBRUBYARG\_SHARED) -lgthread-2.0 -lglib-2.0 -lintl  
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk\_pixbuf-2.0  
-lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo  
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -lcairo -lruby-cairo  
-lruby-cairo -lruby-glib2 -lruby-glib2 -lruby-pango -lruby-pango  
-lruby-gtk2 -lruby-gtk2 -lshell32 -lws2\_32

It link to ruby-gtk2 but at this time, we haven’t compile the  
libruby-gtk2.a yet. So, I have to remove those 2 -lruby-gtk2 -lruby-gtk2  
then it can compile successfully. I test the gtk-demo and it works well.

Have anyone seen this issue on the gtk Makefile?

Here, I attached my compilation process, hopefull help those who want to  
have ruby gnome work with the latest rubyinstaller (Or anyone want to  
add it into the ruby gnome wiki 🙂 or create a windows installer?

# Grab require library:

1. Grab the ruby and ruby development kit from:  
[Downloads](http://rubyinstaller.org/downloads/)
2. Install ruby at c:\ruby and extract the development kit to c:\ruby as  
well
3. Add c:\ruby\bin to windows PATH
4. Grab gtk development library from:  
[http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/glade3-3.6.7-with-GTK+.exe](http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/glade3-3.6.7-with-GTK+.exe)
5. Install it to c:\gtk
6. Add c:\gtk\bin to windows PATH

# Compile Glib

extract ruby-gtk2-0.19.1 to any path like c:\ruby-gtk

> cd glib  
> ruby extconf.rb  
> Need to modify the src/Makefile, add include path  
> INCFLAGS = -I. -I. -IC:/Ruby/lib/ruby/1.8/i386-mingw32 -I.  
> -IC:/gtk/include

- the -I c:/gtk/include is added by hand

> make  
> make install

# Get rcairo

Get from: [http://cairographics.org/releases/rcairo-1.8.0.tar.gz](http://cairographics.org/releases/rcairo-1.8.0.tar.gz)  
Compile it by doing:

> ruby extconf.rb --with-pkg-config=c:\gtk\bin\pkg-config.exe  
> Modify Makefile:  
> INCFLAGS = -I. -I. -IC:/Ruby/lib/ruby/1.8/i386-mingw32 -I.  
> -Ic:/gtk/include/cairo  
> LIBPATH = -L. -L$(libdir) -Lc:/gtk/lib  
> Then run:  
> make  
> make install

# Set cairo path(to the path you extract it)

set CAIRO\_PATH=C:\rcairo-1.8.0\src

# Compile ATK

> cd atk  
> ruby extconf.rb  
> make  
> make install

# Compile pango

> cd pango  
> ruby extconf.rb  
> Modify Makefile:  
> LIBPATH = -L. -L$(libdir) -LC:/rcairo-1.8.0/src  
> make  
> make install

# Compile gtk2

> cd gtk2  
> ruby extconf.rb  
> Modify Makefile  
> LIBPATH = -L. -L$(libdir) -LC:/Ruby/rbgtk/rcairo-1.8.0/src  
> \*\*remove -lruby-gtk2 from the LIBS  
> LIBS = $(LIBRUBYARG\_SHARED) -lgthread-2.0 -lglib-2.0 -lintl  
> -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk\_pixbuf-2.0  
> -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo  
> -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -lcairo -lruby-cairo  
> -lruby-cairo -lruby-glib2 -lruby-glib2 -lruby-pango -lruby-pango  
> -lshell32 -lws2\_32  
> make  
> make install

The compilation process is not so smooth. If we able to make a  
environment include path and the library path, then we can just run the  
extconf.rb at the top directory of the ruby-gtk2-0.19.1 and do make &&  
make install (still we need to manually remove the -lruby-gtk2 from the  
gtk Makefile)
