Is Ruby ready for prime time?

I am a retired developer with 53+ years as of retirement in 2007. While
I am fluent in C/C++ and many other computer languages, all of my recent
work has been in Java. I decided to learn ruby and use Ruby for a
project I had in hand. I am very favorably impressed by the language.
But language is only part of the story. The first problem was what type
of graphics environment to use. Shoes seemed a bit simplistic, and I am
working on Windows. For my Windows 7 PC, finally I settled upon Ruby
1.9.3 and Gtk2, which I also undertook to learn.

All seemed to be going well – the usual development issues. Then I hit
a segmentation fault. I tried reporting it, but was unable to join to
log on:- I received no validation email. Okay, that’s the reporting, but
how about the project? After trying several different ways to restate
the processing in order to avoid the fault, it stubbornly persisted. I
downloaded and installed 2.0.0, but the Gtk2 gems for it would not
compile. So then I thought to try JRuby. In order to use JRuby (1.9.3),
I had to rewrite a bit of the GUI, but then I hit another error:
"Argument Error: Java package ‘java’ does not have a method ‘append
features’. …

So now I am up the creek without a paddle. No Ruby I’ve tried will do
it. It may be my code, since in Ruby I am a newbie, but without adequate
error messaging I wont know what to do. Alternatively, it might really
be a missing method from the Java package. I cannot reach the jruby
developers, just as I cannot reach the ruby 1.9.3 developers, and are
they really interested in view of the releases of 2.0.0 and the more
recent ones of 2.1.2 (not yet ruby installer). I have this part-way made
thing, and unless someone can offer a way forward, the only way that it
can get made seems to return to Java. It would be a shame because I
really like the Ruby language, and it seems too bad that the available
software is not more mature.

Have you tried Gtk3? Are you able to isolate the segfault to a minimal
amount of code to make it reproducible for testing?

You’ll find that there aren’t many GUI apps in Windows written in Ruby.
Most of the community use Linux-based O/S, so Ruby may not be the
easiest language to develop that kind of program with.
I’ve made a few simplistic ones myself, but I moved towards Rails sites
as a platform in the long term.

I use Ruby as a scripting language on Windows, and my god it’s beautiful
for that purpose; but I have yet to find an easy & reliable way to
package it in executable form for Windows, especially with a GUI
framework like Gtk2. So far the best combination I’ve found was Inno
Setup with Ocra, but the resulting application installation is large and
easy to plagiarise.

Compiling gems for Windows from Ruby 2.0+ is a tricky thing, since now
that there are x86 and x64 versions of Ruby, the “gem install” doesn’t
often compile for you anymore. Usually you can go to the gem authors for
support with that, and hope that they have a spare Windows box around to
develop on.

Try with rubygnome again, it has the bindings for GTK as well and the
main japanese author tries to help.

If you found an error, please report it.

Report here:

Ruby-Gnome 2 - Ruby-Forum

Relatively good experience with ruby-gtk2 from mentioned Ruby-GNOME2
project, installed with gtk2 gem.

There were some stability issues in the far past but recent years
releases seem to be ok. We are using it for a GUI to our toolboxes,
deployed on Linux/BSD systems and all works as expected.

I’d stick with mature and well tested Gtk2. After toying with Gtk3, even
in its `born’ C, we’ve ditched it soon as there were several issues and
incompatibilities even with itself (between minor versions).

Have you considered IronRuby? I’ve not used it, but it would seem to be
an option for building Windows GUI apps. Although a bit dated.

Another GUI option in ruby is wxRuby. But the wxRuby wiki disappeared,
and wxRuby seems to be fading into oblivion.

The bottom line is that the state of Gui programming in Ruby is
deplorable, except for Shoes, so I think you chose the wrong language.
Try Python instead. Ruby has never been able to keep up with the big
kid on the block.

I want to thank all of the responders. While I have not answered them
individually, I have read and factored in their responses, and am most
grateful to all who have taken the time to comment.

Although I was reluctant to do it, I dropped back to the tk GUI. The
current-day tk is much better than when I last looked a number years
ago. Notable is the addition of ‘grid’, which was not available in the
days I worked with tk. It may not be the solution I end up with, but for
now, I can make progress with the main body of the work. Then revisit
the GUI later on.
Another change was from 1.9.3, which I had regarded as extremely stable
until the problem occurred, up to Ruby 2.0.0.We

In general, I am looking for a solution which would play well both on
max OSX and Windows 7/8/x. This may force me into a browser-based GUI
solution. We shall see.

Again, many thanks to all.

HI I have been retired from main frame programing for 18 years with 30
years of prog skills from binary thru to cics with programing langs for
28 diff langs. the past 18 years has been with windows pc m/s 16 bit
cobol
was working fine untill the new pc went to 64 bit, so out the door we go
with cobol. i had taken a course in RUBY but some of my questions were
never answered. the old cobol i was using had built in all the screen
I/O, file handling, printer code, and can be handled all with in one
program. when taking the ruby course i never had any exersizes that
covered reading/writing files or screen i/o other than puts statement.
can ruby do all the above or should i look else where.
Any help would be great.

Thank you.

Why don’t you try FXRuby? Is FOX C++ binding, so will be easy for you.
http://rubygems.org/gems/fxruby

Dave Green wrote in post #1157662:

the old cobol i was using had built in all the screen
I/O, file handling, printer code, and can be handled all with in one
program.

The modern COBOL is Java (and/or csharp) : they are supported by big
entreprise like banc & assurance…

You never find so complete support in ruby : it is used mustly by
startup, administrator,…

when taking the ruby course i never had any exersizes that
covered reading/writing files or screen i/o other than puts statement.

screen io is so old school, you will not find useful things.
reading/writing file are easy in ascii/unicode, what course do you
practice ?

For binary data, it is painful (as many script langage) : pack/unpack…
You should use sql (ore nosql) database.

can ruby do all the above or should i look else where.

Java, Go, …

Dave Green wrote in post #1157662:

the old cobol i was using had built in all the screen
I/O, file handling, printer code, and can be handled all with in one

For old stuff, use old tools, (screen art, direct files access,…)

for today stuff, you can use ruby (web,webapp,nosql,big data,…)

for very recent technologies,
perhaps JavaScript/node.js seem much used (webgl, web-kit apps, p2p)
see PopCorn Time, peerflix, girhub apps, webgl game/demos, firefow os,
chrome os…)

Personaly i look for rewriting ppt/peerflix in ruby/gtk/gstreamer : I
found
nothing in ruby environnement…

Regards,

can ruby do all the above or should i look else where.

Yes, sure. Just pick up Programming Ruby book. The old one is free
around the web.

Dave Green wrote in post #1157662:

HI I have been retired from main frame programing for 18 years with 30
years of prog skills from binary thru to cics with programing langs for
28 diff langs. the past 18 years has been with windows pc m/s 16 bit
cobol
was working fine untill the new pc went to 64 bit, so out the door we go
with cobol. i had taken a course in RUBY but some of my questions were
never answered. the old cobol i was using had built in all the screen
I/O, file handling, printer code, and can be handled all with in one
program. when taking the ruby course i never had any exersizes that
covered reading/writing files or screen i/o other than puts statement.
can ruby do all the above or should i look else where.
Any help would be great.

Thank you.

I would like to thank all the people that replyed to my post “Thank you”
i did purchase two ruby books and will see where that takes me.
a question was asked what course i took it was (online) codecademy
i did finish the java and ruby courses, but was disappointd with the
lack of follow up. meaning no explaination on how to run java or ruby on
ones own pc. was able to figure most out. Thank you again.
just for your info one of the best programming langs was wk10 abolutely
the best you could whip up a program in nothing flat and work first time
was written by 10 programmers for programmers.

dave

Dave Green wrote in post #1157662:

HI I have been retired from main frame programing for 18 years with 30
years of prog skills from binary thru to cics with programing langs for
28 diff langs. the past 18 years has been with windows pc m/s 16 bit
cobol
was working fine untill the new pc went to 64 bit, so out the door we go
with cobol. i had taken a course in RUBY but some of my questions were
never answered. the old cobol i was using had built in all the screen
I/O, file handling, printer code, and can be handled all with in one
program. when taking the ruby course i never had any exersizes that
covered reading/writing files or screen i/o other than puts statement.
can ruby do all the above or should i look else where.
Any help would be great.

Thank you.

Hi. Sorry it took very long to get back to you. Your career is similar
to mine, except that after I got really expert with COBOL, I never let
anyone know that I knew it. Similarly with older computers. Thus I
always got to try the new stuff. Have you looked at Java? It is an
interpreted language, so it cannot be used for real-time, or anything
where very high speed is required, but until Ruby, as a language, it was
the best. It is quite fast, and mostly bug-free. Java may still be best,
because I am still having trouble with a GUI for Ruby, while Java’s GUIs
are very nearly part of the language - its got 3 of them: heavyweight
2D, lightweight 2D, and 3D.

If you do try Java, the first shell-shock is immersion into the world of
object-oriented programming. That is the really big step. But Ruby is
also completely Object-Oriented, more so than Java, so if your class
remains with you, it might not be so traumatic.

Direct answer: Ruby can do every one of the things you listed. And more.
So can Java.

As to one program, it depends upon what you mean. Everyone these days
does not write one program. Instead, it gets broken up amongst many
different classes of objects. Each class is often one file, but
sometimes very minor classes are packed into the same file as the main
class, but that is not usually a good way to go. Many, but not all times
I’ve done that, I frequently need that class more widely, and wind up
moving it. The instances of the classes wind up communicating between
themselves ASIF they are one program, and are relatively more loosely
coupled than what is within the one class.

For an update, I’ve gotten quite far along with Tk, which does seem to
work Ok, but it does not feel like a good GUI. The Java GUI is good, and
a heavily stressed feature is that one can use it from JRuby. Well, when
I tried using it from Jruby, it yielded ‘module “append_features”
missing from the jruby jar’. If it really true and not an artifact of
something else, then this is not within my control.

Good Luck