On 01/31/2012 07:11 PM, mark kirby wrote:
> Hi
> I just wonderd if you guys know any way to execute a .rb file by
> clicking on it.
> For a while now I have used the terminal to run files, even with
> graphics.
> 
> user@computer: ruby /PATH TO FILE.rb

This isn't really a Ruby-specific issue but rather a Gnome issue.
Apparently, the only way to get the option to make the file association
to your Ruby interpreter is to create a .desktop file in
/usr/share/applications with the necessary details for Gnome to offer
Ruby as a potential application to open files.  Assuming you have such a
.desktop file, you should be able to right click on the file and select
Ruby via the "Open With Other Application..." menu item.

Unfortunately, I don't really have any experience with .desktop files.
I believe they are basically like INI files, and you can find some
examples already on your system under /usr/share/applications.  Aside
from that, I can't provide much better help than these links:

The spec: http://standards.freedesktop.org/desktop-entry-spec/latest/

Helpful tools:
http://mail.gnome.org/archives/desktop-devel-list/2002-May/msg00271.html

> Any help would be great, I heard you can compile ruby with G++.
> 
> Can that be true?
> 
> It seems ridiculus to me.

Indeed, I have never heard of anyone directly compiling Ruby source into
native code using g++.  I think I remember reading about a couple
projects a long time ago that would convert some subset of the Ruby
language into C code.  Theoretically, you would be able to compile your
sources that way, but I don't think those projects are still alive or
know if they even really worked at all.

-Jeremy