Building desktop application using Ruby and any GUI Framework

I want to write a small desktop application on Ruby. I want the
application to be platform independent. I am using Fedora Linux for
building app. but I want the application to run on Windows as well.

I want to make use of any easy to use GUI tool. QT designer is already
installed on my Linux. Which other GUI frameworks are easy to use for a
Ruby beginner to use? It should have a wide user base so that help is
easily available.

Hi Rohit (I’m Rohit too!)

I wrote some ruby-gtk2 code a while back and it was not at all a bad
experience:

I wouldn’t call it widely used outside of Linux, but my code was
portable
to both Windows and OSX. Users of Windows, simply have to install Ruby
and
then install GTK2 libraries.

There should be pretty good docs on the website, but I can give you some
working samples I wrote that deal with gnome notificatiers.

Rohit

On Sun, Jan 22, 2012 at 8:08 AM, Rubyist R. <

@Rohit M.:

Hi,

What type of application you built using GTK? Are you using any
database-backend as well?

You should give green_shoes[1] a try.

It’s an ever so pleasant DSL built on top of Ruby GTK2, here’s a
sample from the readme:

require 'green_shoes'

Shoes.app( :width => 250, :height => 250 ) do
  para 'Hello, world!'
  image 'images/shoes.png'
end

All you need to get started is ruby 1.9.2, rubygems 1.5+, and the gtk2
gem (which may be automatically installed for you when installing the
green_shoes gem): then you’re ready to install green_shoes:

gem install green_shoes

The best part, other than the super friendly api, is that your apps
will run on linux and windows without any modification. They may even
work on OSX, but I’m not sure the current state of support for mac.

zzak

1: GitHub - ashbb/green_shoes: Green Shoes is one of the colorful Shoes written in pure Ruby.

On Mon, Jan 23, 2012 at 5:05 PM, Zachary S.
[email protected]wrote:

image ‘images/shoes.png’
will run on linux and windows without any modification. They may even
work on OSX, but I’m not sure the current state of support for mac.

Just tried on Ubuntu 10.04 (in rvm with 1.9.3) and it installed
like a charm :slight_smile: The test program also worked immediately.

$ cat Gemfile
source :rubygems

gem ‘green_shoes’

$ bundle install
Fetching source index for http://rubygems.org/
Installing pkg-config (1.1.2)
Installing glib2 (1.1.2) with native extensions
Installing atk (1.1.2) with native extensions
Installing cairo (1.10.2) with native extensions
Installing gdk_pixbuf2 (1.1.2) with native extensions
Installing pango (1.1.2) with native extensions
Installing gtk2 (1.1.2) with native extensions # this took a minute or
so
Installing green_shoes (1.1.354)
Using bundler (1.0.21)

HTH,

Peter

To warm up your research…

Tip: Some of them are better than the others when dealing with an
specific constraint/objective. In a small project of mine I wrote 3
(simple) GUIs (looking the same) using tk, wxRuby, RubyCocoa.

Abinoam Jr.

On Sun, Jan 22, 2012 at 2:33 PM, Rubyist R.

Rubyist R. wrote in post #1042024:

I want to write a small desktop application on Ruby. I want the
application to be platform independent. I am using Fedora Linux for
building app. but I want the application to run on Windows as well.

Ruiby :

http://regisaubarede.posterous.com/

It should have a wide user base so that help is easily available.

yes, one user: me :)]

Oh, I should clarify, you can use any ruby that is >= 1.9.2, I’m not
sure about 1.9.1 but 1.9.2 and 1.9.3 both work exceptionally well.

There’s also a great many number of samples available in the github
repo: green_shoes/samples at master · ashbb/green_shoes · GitHub

zzak

On Mon, Jan 23, 2012 at 11:22 AM, Peter V.

Ruby-gtk runs on Windows too.

Wide user base can be a problem, there are not that many ruby users, and
only 1% of them use something like ruby-gtk.

But you will be able to ask for help on the mailing list.

hello,
the simpler for Windows is to use the RubyInstaller
(http://rubyinstaller.org/).
it now include TK, so it’s really the
easiest way to go, for Windows.

good informations about it here : TkDocs Home

Oh, I should clarify, you can use any ruby that is >= 1.9.2, I’m not
sure about 1.9.1 but 1.9.2 and 1.9.3 both work exceptionally well.

There’s also a great many number of samples available in the github
repo: green_shoes/samples at master · ashbb/green_shoes · GitHub

Green shoes looks nice. I wish there were a (java/jruby) equivalent to
shoes/green shoes…

Green shoes looks nice. I wish there were a (java/jruby) equivalent to
shoes/green shoes…

Have you tried the Glimmer Desktop Development Library for Ruby? Not only does it offer cross-platform support and native-UI, but it also provides a programmer-friendly declarative DSL, data-binding support, scaffolding, and packaging (e.g. make a Mac DMG app file). It was originally presented at RubyConf 2008.

If you’re using Mac OS X then you’d likely want to use MacRuby, which allows you to create desktop apps. I think its one of the cleanest ways to develop for the desktop using Ruby

MacRuby has not been maintained since 2015. Also, I know a developer who hated learning to deal with the Cocoa APIs directly in Ruby so much he thought it was easier to use Swift at that point. But, thankfully, the open-source Glimmer DSL for LibUI comes to the rescue (among other Glimmer GUI toolkits; there are 6 others)! It has won a Fukuoka Ruby 2022 Special Award after getting judged by Matz, the creator of Ruby. It provides a great abstraction DSL that enables building desktop apps for all of Mac, Windows, and Linux with the same simple Ruby codebase. That said, the most complete Glimmer desktop development library is Glimmer DSL for SWT, which runs on JRuby, supporting native executable packaging on Mac (APP/DMG/PKG), Windows (EXE/MSI), and Linux (DEB/RPM). Both options (for CRuby and JRuby) are great entry points into Glimmer GUI desktop development in Ruby.