I've got a ruby script myscript.sh like this
#!/usr/bin/env ruby
puts 'do some ruby stuff'
opening a terminal and calling it with ./myscript.sh just works fine.
But when I try doubleclicking the file it does not.
A simple shell script like this works just fine either by doubleclicking or terminal.
#!/bin/bash
echo 'TEST' > Test.txt
I am using Ubuntu 11.04
I also use rvm aka Ruby Version Manager. The Problem was that I also require nokogiri. So I needed to set up rvm in my Scriptings to resolve the necessary resources, which I did with a startscript containing
#!/bin/bash
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
\# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
\# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
./myscript.sh
My guess is it runs in background, with no window.
Try:
and check if
rubytest.txt
exists.