On 02/06/2012 01:50 PM, Adam Ms. wrote:
> Jeremy Bopp wrote in post #1044360:
>> On 02/06/2012 09:59 AM, Adam Ms. wrote:
>>> mark kirby wrote in post #1043353:
>>>> Hi
>>>> I just wonderd if you guys know any way to execute a .rb file by
>>>> clicking on it.
>>>
>>>>
>>>> ;-) THANKS
>>>
>>> Add a ruby shebang and chmod +x
>>
>> This may not be the best possible solution unless you can safely rely on
> 
> I think this will work with RVM on Ubuntu:
> 
> #!/usr/bin/env ruby

It will only work when running from Nautilus or similar file browsing
program *if* you have arranged to select a Ruby with RVM during the
startup of your session; otherwise, the shebang above will either find
the system Ruby or fail if you don't have one installed.  In any case,
you cannot change the selected Ruby without restarting your session
because all of your programs will inherit the settings set at the
beginning of the session.  In other words, you cannot start a terminal
and run RVM to change your Ruby selection for all programs in your
current session and then have Nautilus see that change.

Your suggestion will only really work for people running the scripts
from the command line (which is what I do on my Ubuntu systems), but
that's not what the OP wanted to do. :-)

-Jeremy