1. Home
  2. Computing & Technology
  3. Ruby

How to Install wxRuby on Ubuntu Linux

By Amanda & Michael Morin, About.com

Installing wxRuby on Ubuntu Linux 8.10 isn't all that difficult to do. It could, in fact, be a lot harder than it is. Like with all gems that require native extensions it is slightly more complicated than a simple gem install but, thanks to the pre-compiled code in the gem, not by much.

These instructions are written for Ubuntu 8.10. They may apply to later or earlier versions of Ubuntu, as well as other Linux distributions, too.

  1. Install wxWidgets base. wxRuby2 depends on wxWidgets 2.8.x. If you already have wxWidgets installed but you don't know which version, you can try checking with your package manager or with the wx-config --version command.
    $ sudo gem install libwxbase2.8-{0,dev}
  2. Install wxWidgets GTK widgets.
    $ sudo gem install libwxgtk2.8-{0,dev}
  3. Install the wxRuby gem.
    $ sudo gem install wxruby
  4. Test the installation.
    $ cd /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-x86-linux/samples $ ruby -rubygems minimal/minimal.rb

If everything goes right, you should see a small GUI application pop up.

If this doesn't work, you may have to install wxRuby from source. This is quite an involved process, especially if you have to install wxWidgets itself from source as well. However, if you the follow the directions here, the entire process shouldn't take more than half an hour.

More Ruby Quick Tips
Explore Ruby
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Ruby
  4. Gems
  5. Installing wxRuby--How to Install wxRuby on Ubuntu Linux

©2009 About.com, a part of The New York Times Company.

All rights reserved.