# wxRuby 2.0.0

**URL:** <https://www.ruby-forum.com/t/wxruby-2-0-0/161794>\
**Category:** Ruby\
**Created:** [March 2, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794 "2009-03-02T14:36:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 2, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/1 "2009-03-02T14:36:06Z")

</div>

I’m happy to announce the release of wxRuby 2.0.0, the comprehensive,  
cross-platform GUI toolkit for Ruby. Though recent versions have been  
very usable (and much used), this is the first official stable release  
from the project, the fruit of several years development.

[http://wxruby.rubyforge.org/](http://wxruby.rubyforge.org/)

== Minimal Example

require ‘wx’  
Wx::App.run do  
frame = Wx::Frame.new(nil, :title =\> ‘Welcome to wxRuby’)  
frame.show  
end

== Why wxRuby?

There are several fine GUI toolkits for Ruby, but wxRuby offers a  
combination of advantages that we feel isn’t equalled by any other:

- Uses real native widgets on Windows, OS X and Linux/GTK, giving  
applications OS-standard appearance and behaviour
- Fully supports Ruby 1.8 and Ruby 1.9
- Provides a comprehensive set of GUI controls, including advanced  
widgets: a rich text editor, Scintilla code editor, a spreadsheet,  
IDE-style layouts, a media player etc
- Cross-platform support classes for printing, the clipboard, drag/drop  
between applications, locales, images etc
- Uses a liberal licence, compatible with free and commercial  
development
- Based on the mature, widely used and actively developed wxWidgets  
library
- Works with a range of free and commercial RAD tools for visually  
designing GUIs
- Easy to install, package and redistribute
- Highly customisable from the ground up

== Installation

Binary gems are provided for nine major platforms. For most users,  
especially on Windows and OS X, installing from a binary gem will be  
easiest. For now, we recommend you download the gem for your platform  
from the file page:

[http://rubyforge.org/frs/?group\_id=35&release\_id=31815](http://rubyforge.org/frs/?group_id=35&release_id=31815)

And install it locally using “gem install ”. Rubygems seems to  
be failing to offer the latest version for remote installation in some  
cases.

Linux users will need their distro’s libwxgtk-2.8; see INSTALL.txt for  
more information.

For users wanting to get started quickly on GUI development with Ruby  
1.9, there’s also a setup package containing MingW, Ruby 1.9 and wxRuby  
2.0.0.

== Credits

Thanks to all those who’ve contribute to the project over the past few  
years, supplying patches, bug reports, suggestions for enhancements, and  
just being interested in making wxRuby as good a GUI tool as possible.  
Known contributors are listed in the README distributed with wxRuby.

== Further Information

wxRuby homepage:  
[http://wxruby.rubyforge.org/](http://wxruby.rubyforge.org/)

Rubyforge project page:  
[http://rubyforge.org/projects/wxruby/](http://rubyforge.org/projects/wxruby/)

wxruby-users mailing list:  
[http://rubyforge.org/mailman/listinfo/wxruby-users](http://rubyforge.org/mailman/listinfo/wxruby-users)

API docs:  
[http://wxruby.rubyforge.org/doc/](http://wxruby.rubyforge.org/doc/)

\_\_

alex

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 2, 2009, 2:48pm UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/2 "2009-03-02T14:48:08Z")

</div>

Alex F. wrote:

> I’m happy to announce the release of wxRuby 2.0.0, the comprehensive,  
> cross-platform GUI toolkit for Ruby.

Congrats 🙂

> For users wanting to get started quickly on GUI development with Ruby  
> 1.9, there’s also a setup package containing MingW, Ruby 1.9 and wxRuby  
> 2.0.0.

Thanks for doing that on mingw 😛  
Could I make a plea for 1.9 windows users to try to consolidate on  
mingw, versus other compilers? Cross It would make it easier , and have  
less targets for binary distributables [and they’re easier, thanks to  
Luis’ cross compiler [1]]. It would also coalesce open source projects,  
so we could all benefit each other [mingw is open source, VC not].  
It’s just my opinion but it would seem to make sense.  
Thoughts?

-=r  
[1] [GitHub - rake-compiler/rake-compiler: Provide a standard and simplified way to build and package Ruby C and Java extensions using Rake as glue.](http://github.com/luislavena/rake-compiler/tree/master) see also  
[http://blog.mmediasys.com/2008/12/13/while-leaving-ny-rake-compiler-for-the-masses/](http://blog.mmediasys.com/2008/12/13/while-leaving-ny-rake-compiler-for-the-masses/)  
and [http://www.holymonkey.com/building-shoes-in-windows](http://www.holymonkey.com/building-shoes-in-windows) [the last for  
how to build mingw ruby 1.9]

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 2, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/3 "2009-03-02T18:08:50Z")

</div>

Alex F. wrote:

> I’m happy to announce the release of wxRuby 2.0.0, the comprehensive,  
> cross-platform GUI toolkit for Ruby. Though recent versions have been  
> very usable (and much used), this is the first official stable release  
> from the project, the fruit of several years development.
> 
> [http://wxruby.rubyforge.org/](http://wxruby.rubyforge.org/)

Very cool.

I looked around the the project site, but did not find any specif info  
on packaging of completed apps for distribution.

How do I bundle up a wxRuby app to give to an end user (who may or may  
not have Ruby installed)?

Can I do all my development on my Ubuntu machine, then bundle up my app  
and hand it off to a Mac or Windows user?

Thanks,

–  
James B.

[www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
[www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 3, 2009, 9:50am UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/4 "2009-03-03T09:50:33Z")

</div>

Alex F. wrote:

> == Installation
> 
> Binary gems are provided for nine major platforms. For most users,  
> especially on Windows and OS X, installing from a binary gem will be  
> easiest. For now, we recommend you download the gem for your platform  
> from the file page:
> 
> [http://rubyforge.org/frs/?group\_id=35&release\_id=31815](http://rubyforge.org/frs/?group_id=35&release_id=31815)

I see:

wxruby-2.0.0-universal-darwin-9.gem

but I’m using:

$ ruby -v  
ruby 1.8.2 (2004-12-25) [universal-darwin8.0]

which as you can says darwin 8.0. I’m using osx 10.4.11 Tiger, which  
was the last release before Leopard osx 10.5. Does that mean there’s no  
soup for me?

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 2, 2009, 10:55pm UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/5 "2009-03-02T22:55:40Z")

</div>

James B. wrote:

> Alex F. wrote:
> 
> > [http://wxruby.rubyforge.org/](http://wxruby.rubyforge.org/)
> 
> Very cool.

Thanks.

> I looked around the the project site, but did not find any specif info  
> on packaging of completed apps for distribution.
> 
> How do I bundle up a wxRuby app to give to an end user (who may or may  
> not have Ruby installed)?

Rubyscript2exe works fine for many cases. On Windows and OS X, wxWidgets  
is statically compiled into wxRuby, so you have everything you need to  
redistribute to others.

For more advanced installations, I’ve used platform-specific tools like  
Platypus (OS X) and NSIS installer (Windows) to ship a complete ruby  
package that works like a compiled native app.

> Can I do all my development on my Ubuntu machine, then bundle up my app  
> and hand it off to a Mac or Windows user?

As with any other MRI native extension, a compiled wxRuby library is  
specific to platform (= OS + processor + major ruby version). The ruby  
code works independently, but you can’t build a rubyscript2exe on Linux  
for Windows.

But given that the way desktop apps are expected to work varies  
considerably by OS, you’re going to want to test on Mac before you hand  
it off from Ubuntu, aren’t you?

alex

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 3, 2009, 9:50am UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/6 "2009-03-03T09:50:43Z")

</div>

Roger P. wrote:

> Could I make a plea for 1.9 windows users to try to consolidate on  
> mingw, versus other compilers? Cross It would make it easier , and have  
> less targets for binary distributables [and they’re easier, thanks to  
> Luis’ cross compiler [1]].

I’m +1 on that, in theory. Having different 1.9 builds for Windows  
washing about makes it more difficult to provide pre-built gems.

MingW is familiar for those using gcc on other platforms; the main  
downside I’ve found is that the support tools (eg gdb) are a bit flaky  
at the moment. Eg gdb sometimes exits unexpectedly while debugging, and  
the key entry/prompt/shell gets muddled easily.

a

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 3, 2009, 10:36am UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/7 "2009-03-03T10:36:35Z")

</div>

7stud – wrote:

> was the last release before Leopard osx 10.5. Does that mean there’s no  
> soup for me?

I don’t know for certain b/c I don’t have a 10.4 machine to test on.

There are specific steps taken in the build (eg ways of configuring  
wxWidgets) to provide backwards compatibility, so I hope it might work.  
If you could try it, I’d be interested in the results.

a

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 24, 2009, 8:17am UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/8 "2009-03-24T08:17:51Z")

</div>

Alex F. wrote:

> 7stud – wrote:
> 
> > was the last release before Leopard osx 10.5. Does that mean there’s no  
> > soup for me?
> 
> I don’t know for certain b/c I don’t have a 10.4 machine to test on.
> 
> There are specific steps taken in the build (eg ways of configuring  
> wxWidgets) to provide backwards compatibility, so I hope it might work.  
> If you could try it, I’d be interested in the results.

I finally got around to trying this. But I can’t even untar the wxRuby  
gem:

$ tar -xvf /Users/me/Desktop/wxruby-2.0.0-universal-darwin-9.gem.tar  
data.tar.gz  
tar: data.tar.gz: implausibly old time stamp 1969-12-31 17:00:00  
metadata.gz  
tar: metadata.gz: implausibly old time stamp 1969-12-31 17:00:00  
$

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [March 24, 2009, 9:14am UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/9 "2009-03-24T09:14:42Z")

</div>

7stud – wrote:

> Alex F. wrote:
> 
> > 7stud – wrote:
> > 
> > > was the last release before Leopard osx 10.5. Does that mean there’s no  
> > > soup for me?
> > 
> > I don’t know for certain b/c I don’t have a 10.4 machine to test on.
> > 
> > There are specific steps taken in the build (eg ways of configuring  
> > wxWidgets) to provide backwards compatibility, so I hope it might work.  
> > If you could try it, I’d be interested in the results.
> 
> I finally got around to trying this. But I can’t even untar the wxRuby  
> gem:
> 
> $ tar -xvf /Users/me/Desktop/wxruby-2.0.0-universal-darwin-9.gem.tar  
> data.tar.gz  
> tar: data.tar.gz: implausibly old time stamp 1969-12-31 17:00:00  
> metadata.gz  
> tar: metadata.gz: implausibly old time stamp 1969-12-31 17:00:00  
> $

Ok, there is some weirdness with osx and safari and the names of  
downloaded files, which I rediscovered here:

[http://www.ruby-forum.com/topic/141008](http://www.ruby-forum.com/topic/141008)

So I changed the filename on my Desktop to:

wxruby-2.0.0-universal-darwin-9.gem

(I removed the .tar extension on the end). Then I changed directories  
to my Desktop:

$ cd ~/Desktop

and then commanded:

~/Desktop$ gem install wxruby-2.0.0-universal-darwin-9.gem

and I immediately got a message that said wxruby installed successfully.  
Wow that was fast.

Ok, now to test the install. I found a basic wxruby example here:

[http://book.opensourceproject.org.cn/lamp/ruby/cookbook/opensource/0596523696/rubyckbk-chp-21-sect-14.html](http://book.opensourceproject.org.cn/lamp/ruby/cookbook/opensource/0596523696/rubyckbk-chp-21-sect-14.html)

Instead of typing in the whole example, I decided to see if requiring  
wxruby would work first.

## r1test.rb

require ‘wxruby’

Nope:

r1test.rb:1:in `require’: No such file to load – wxruby (LoadError)  
from r1test.rb:1

Oh yeah, there’s some ruby gem weirdness about requires. Checking my  
notes in pickaxe2, I came up with this:

require ‘rubygems’  
require ‘wxruby’

Still didn’t work:

/usr/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': No such file to load -- wxruby (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
from r1test.rb:2

Hmm…the basic example at the link above mentions a tutorial here:

[http://wxruby.rubyforge.org/wiki/wiki.pl?Getting\_Started](http://wxruby.rubyforge.org/wiki/wiki.pl?Getting_Started)

Ahh, the tutorial uses:

require ‘wx’

Nope:

r1test.rb:1:in `require’: No such file to load – wx (LoadError)  
from r1test.rb:1

Ok, how about:

require ‘rubygems’  
require ‘wx’

That worked. On to the example:

require ‘rubygems’  
require ‘wx’  
include Wx

class TroutApp \< App  
def on\_init  
frame = Frame.new(nil, -1, “Title”)  
text = StaticText.new(frame, -1, “You are a trout!”,  
Point.new(-1, 1), DEFAULT\_SIZE, ALIGN\_CENTER)  
frame.show  
end  
end

TroutApp.new.main\_loop

And that worked. So I guess you have your answer.

---

<div class="post-metadata">

**Author:** ![absolute-beginner](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@absolute-beginner](https://www.ruby-forum.com/u/absolute-beginner)\
**Post date:** [June 5, 2010, 7:07pm UTC](https://www.ruby-forum.com/t/wxruby-2-0-0/161794/10 "2010-06-05T19:07:24Z")

</div>

Alex F. wrote:

> Rubyscript2exe works fine for many cases. On Windows and OS X, wxWidgets  
> is statically compiled into wxRuby, so you have everything you need to  
> redistribute to others.
> 
> For more advanced installations, I’ve used platform-specific tools like  
> Platypus (OS X) and NSIS installer (Windows) to ship a complete ruby  
> package that works like a compiled native app.
> 
> > So your answer is that using ocra or rubyscript2exe is enough to make an executable after the WXRUby application that works without problems on any Windows, even on those that do not have Ruby installed ?
