139

Whats the best/easiest GUI library out there for Ruby?

I would prefer a cross-platform GUI library, but currently I'm only concerned about Windows (Win32). I am having difficulting finding any that seem to be easy to use. Are there any?

Chris Pietschmann
  • 29,502
  • 35
  • 121
  • 166
  • 1
    I have created a site proposal to give questions like this an official home away from Stack Overflow. It's called [Code Recommendations](http://area51.stackexchange.com/proposals/66606/code-recommendations?referrer=S-_R40wBFZh6TlZ3Al4_Sw2) Help make it a reality by joining and asking questions now! – daviewales Mar 23 '14 at 13:00
  • 2
    Would be nice if a Mod could move this one over to the "Software Recommendations" site. http://softwarerecs.stackexchange.com – Chris Pietschmann Mar 26 '14 at 16:55
  • 4
    YES - this should be a feature on THIS site - *closed as software recommendation*, moving it to that SE. There are so many useful posts on this site closed as 'not constructive' when actually they are just misplaced. – Adam Tolley Apr 18 '14 at 18:52
  • I asked http://softwarerecs.stackexchange.com/questions/25199/whats-the-best-easiest-gui-library-for-ruby-supporting-linux-as-minimal-requi – reducing activity Sep 28 '15 at 10:32
  • See [With what tools can I make a complex and advanced GUI with Ruby?](https://softwarerecs.stackexchange.com/q/53553/36725). – sondra.kinsey Apr 10 '19 at 00:33

19 Answers19

86

Ruby Shoes (by why) is intended to be a really simple GUI framework. I don't know how fully featured it is, though.

Some good code samples can be found in the tutorials.

Also, I think shoes powers hackety hack, a compelling programming learning environment for youngsters.

Ali Almoullim
  • 1,028
  • 9
  • 30
Jacob Carpenter
  • 4,134
  • 1
  • 29
  • 30
  • 2
    where do you find it now whytheluckstiff is gone? – knoopx Dec 16 '09 at 15:31
  • 2
    AFAIK http://shoes.heroku.com is the new post-_why home for all things shoes. – Pete Hodgson Feb 04 '10 at 23:45
  • 1
    The version at http://shoesrb.com/downloads is "3", while the latest version at https://github.com/shoes/shoes/downloads is "3.1.0", while "gem install shoes" installs "3.0.1". What's up with the versoning pandemonium? Is this because _why disappeared? – Alexander Jan 02 '12 at 00:28
  • 6
    Shoes is not made for production environment but for fun, it is the "turtle graphic" of Ruby. It is intended for newbies to get acquainted with 1.) domain specific language, 2.) graphics – karatedog Feb 02 '12 at 11:58
  • 17
    For anyone who has anyone intention of using Ruby Shoes, don't. It's buggy and the support is limited. It promises so much but delivers so little. This is because the author has 'disappeared' and leaves behind what appears to be a 3/4 complete project. It doesn't look that way at the start, but when your code starts to get serious, it will not live up to what it promises. Seriously, RUN! – Dane Balia Dec 08 '12 at 20:48
  • @DaneBalia it's been six years, has anything changed with shoes now? – Kishy Nivas Jan 21 '18 at 13:15
  • 1
    @KishyNivas Quite right, thank you. Shoes.rb is now in version 4 and in preview. It looks like worth the shot with an active community of 70. – Dane Balia Jan 21 '18 at 15:03
31

Here is a good resource for you:

http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules

has links comparing basically all of them.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
21

I started with FXRuby because it had a book.

Joe Zack
  • 3,268
  • 2
  • 31
  • 37
12

I recently started using Qt as a GUI framework for a Ruby application. There is a binding called QtRuby. For a quickstart tutorial (covers only windows) see this post

cespon
  • 5,630
  • 7
  • 33
  • 47
Tom
  • 1,096
  • 1
  • 10
  • 15
10

Limelight I really enjoy the theatre metaphor.

Michael Mior
  • 28,107
  • 9
  • 89
  • 113
pmlarocque
  • 1,704
  • 1
  • 18
  • 26
  • 2
    Have you other examples than the one and only calculator demo ? Nothing moves at their website – peter Oct 03 '12 at 21:16
8

Glimmer is an interesting option for JRuby users which provides a very Ruby-ish interface to the SWT toolkit. (SWT is the user interface framework behind Eclipse, which delivers fast performance and familiar UI metaphors by making use of native widgets on the various platforms it supports: Windows, OS X, Linux, etc.) SWT always appealed to me as a Java developer, but coding it was painful in the extreme. Glimmer makes the process a lot more straightforward by emphasizing convention over configuration, and by valuing DRYness and all the other normal Ruby goodness.

Another neat option is SproutCore, a Javascript-based GUI toolkit with Ruby bindings developed by Apple. At least, the demos for it look great, and otherinbox built a pretty slick looking application on top of it. Personally, I've spent quite a few hours trying to get it running on two systems -- one Windows and one Linux -- and haven't succeeded on either one -- I keep running into dependency issues with Merb or other pieces of the SproutCore stack. But it's intriguing enough that I'll go back after a few weeks and try again, hoping that the issues get resolved in that time.

paulbonner
  • 166
  • 2
8

wxWidgets is worth checking out. It is well supported on Ruby via wxRuby. For an example app, have a look at wxRIDE. See it compared to other toolkits. You might also want to check out Anvil, which is a sort of Rails-ish framework for working with wx. It looks moribund now, though.

Charles Roper
  • 20,125
  • 20
  • 71
  • 101
7

If you're looking for a cross-platform GUI, then I'd highly recommend going with JRuby and Swing.

Also, take a look at the monkeybars library, which is a Ruby library for building MVC applications using JRuby and Swing, where you can also use the excellent Netbeans IDE to visually build your GUI.

Dema
  • 6,867
  • 11
  • 40
  • 48
  • 1
    the rubyforge monkeybars link is old, and makes you think the project's abandoned; better go to the project main site (http://www.monkeybars.org), or the github page (https://github.com/monkeybars/monkeybars-core) – fakeleft Feb 01 '11 at 14:28
5

Try visualruby you can easily build your forms using the glade interface designer, then write pure ruby code to animate them. Its much easier than the options mentioned above because you don't have to hand-code everything.

You can see example videos on the visualruby website.

user1182000
  • 1,625
  • 14
  • 12
5

If you're developing for Mac, MacRuby has the best library, hands down. Aside from being blazing fast, it has a very nice GUI interface named hotcocoa. Additionally, the library is developed by Apple, uses the Core Foundation classes as its base, and runs on top of the Objective-C runtime using LLVM. In two words, it's blazing fast.

Mike
  • 23,892
  • 18
  • 70
  • 90
4

There are Ruby bindings for QT and GTK so you can't go wrong with those ones (they're portable too).

The Pragmatic Programmers published a mini book on Ruby with QT and a full book on FXRuby, so I think the latter's another good choice.

Shoes, although easy to learn and cute, is pretty situational and doesn't provide as many options for controls as any of the other ones do, so if you want to build anything beyond a simple UI (not to hate Shoes but it's not mature enough yet), I'd recommend you to use one of the more mature and tested toolkits.

Federico Builes
  • 4,939
  • 4
  • 34
  • 48
3

I've had some very good experience with Qt, so I would definitely recommend it.

You should be ware of the licensing model though. If you're developing an open source application, you can use the open-source licensed version free of charge. If you're developing a commercial application, you'll have to pay license fees. And you can't develop in the open source one and then switch the license to commercial before you start selling.

P.S. I just had a quick look at shoes. I really like the declarative definitions of the UI elements, so that's definitely worth investigating...

bjnortier
  • 2,008
  • 18
  • 18
  • Why can't you develop with the OS version and switch? The same code won't work with both versions? Entirely different APIs or something? – iconoclast Jul 29 '13 at 16:15
3

If you are interested, RubyLearning offers a course on FXRuby and Shoes. Actually, the Shoes course is being conducted currently.

Probably the easiest is Shoes. As an assistant teacher at RubyLearning, I hope that we will have better courses for learners.

Some people got stuck in installing FXRuby. But Shoes has an installer for any platforms (Windows, Mac and Linux).

3

Using the ironRuby interperter you have the full .net platform, meaning you can code Winforms and WPF(I have only tried Winforms). It is potentially cross platform since the mono platform exist

khebbie
  • 2,490
  • 3
  • 31
  • 53
2

Use the browser as GUI using Watir like in this question and answer:

use browser as GUI in Ruby

Community
  • 1
  • 1
peter
  • 41,770
  • 5
  • 64
  • 108
2

Try shoes. Unfortunately, I have not had a chance to work with it yet, but I have an upcoming project where I plan to use it. It is cross-platform. Also the API looks very Rubyish so I would give it a try.

Keith Smiley
  • 61,481
  • 12
  • 97
  • 110
Josh Moore
  • 13,338
  • 15
  • 58
  • 74
2

There's a discussion here that might be useful.

From my own (limited) exposure, I'd say that shoes was the most fun and probably the "easiest" to get into. Be warned, however, that figuring out what was wrong when something breaks can be tricky (at least, it was for me).

For a real-world application that I was planning to deploy to real-world users, I think I'd go with wxruby.

Mike Woodhouse
  • 51,832
  • 12
  • 88
  • 127
2

Tk is available for Ruby. Some nice examples (in Ruby, Perl and Tcl) can be found at http://www.tkdocs.com/

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
2

Wxruby is a great framework, simple and clean. Try it or use glade with ruby (the simpliest option)