The Ruby bindings for cairo.
C Ruby Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
build windows: use Win32 thread again Aug 18, 2016
lib Use double quote (") for string literal May 6, 2015
misc * misc/update-colors.rb: supported X11 color names. Apr 16, 2007
patches windows: upgrade dependencies Sep 6, 2015
test Change Cairo::FontOptions#== value equality check instead of object e… May 8, 2016
.dir-locals.el Add Emacs configuration for .sh Nov 24, 2014
.travis.yml travis: update for the latest Rubies Feb 25, 2016
.yardopts Use .yardopts Dec 4, 2012
AUTHORS Entry only an active author Mar 25, 2012
COPYING reworking documentation Mar 20, 2005
GPL reworking documentation Mar 20, 2005
Gemfile Use "https" for Dec 16, 2013
NEWS Update news Apr 2, 2016
Rakefile windows: use libpng 1.6.23 Jul 29, 2016
cairo.gemspec Remove rubyforge_project form gemspec May 17, 2014 Remove tagging from Apr 5, 2014
extconf.rb support different directory build. Oct 29, 2010






Ruby bindings for cairo // cairo extension for Ruby


  • ruby >= 1.9.3 (2.2 also supported!)

  • cairo >= 1.2.0 (1.12.0 also supported!)



This way is recommended.

# gem install cairo

Self build

For experimental users.

Download rcairo-X.Y.Z.tar.gz from


% tar xvzf rcairo-X.Y.Z.tar.gz


% cd rcairo-X.Y.Z
% ruby extconf.rb    # to check for dependencies and create Makefiles
% make               # to compile

# make install       # to install the cairo extension.
                     # The samples in the samples folder should be able
                     # to run before installation except text-on-path.rb
                     # and text2.rb. They uses Ruby/Pango with rcairo
                     # support. So you need to install rcairo and build
                     # Ruby/Pango with it before you run them.

Options to extconf.rb:

* --without-vendor-override: Use system libraries instead of those found in
                             vendor/local for compiling


cairo-X.Y.Z-x86-mingw32.gem includes cairo related binaries.

  • cairo related binaries:










There is the rcairo repository at GitHub:

Mailing list

If you have trouble with cairo or rcairo, or you have some ideas for how it could be improved, please feel free to send a message to the cairo mailinglist at , which is archived at


  • Yoshinao Muramatsu: win32 surface support patch.

  • NANKI Haruo: some bug fix patches.

  • Paul van Tilburg:

    • some patches that support ruby 1.9.

    • some suggestions.

  • Binzo: some bug reports and fixed that.

  • kimura wataru:

    • some advices for RubyCocoa.

    • reports a bug.

  • OBATA Akio:

    • reports a bug.

    • some suggestions.

  • James Healy: reports bugs.

  • Carsten Bormann: A suggestion.

  • Davide Rambaldi: A suggestion.

  • Yusuke ENDOH: reports a bug.

  • Yuta Taniguchi: a bug fix patch.

  • kimura wataru:

    • reports a bug.

    • some patches.

  • Masayas TARUI:

    • Windows support.

  • Stefan Salewski: reports a bug.

  • Mamoru Tasaka: reports bugs.

  • Nikolai Weibull: reports problems.

  • Will Bryant: reports a bug.

  • Vasily Fedoseyev: fixes a bug.

  • Eric C.: reports a bug.

  • Cédric Boutillier: reports a bug.

  • tmtms: reports a bug.