I suspect that this is a simple problem, and hard for me only because of my modest (!) grasp of Linux basics. Here goes:
I program exclusively in Ruby. I want to execute a Unison script which is run from within a Ruby program, then turn off my computer. The Unison thing simply matches up my on-board HD with an external USB HD I use on another machine. It runs for a while, then I want my computer to shutdown. I'm using the 'shutdown' command to effect that. The idea is to set this running and go to bed. A few minutes later it's done and the computer is off.
"Shutdown' must be run from my admin. acct., of course. But when I enter 'sudo ruby unison.rb' (that's the name of my ruby script), I'm told that Ruby isn't installed. When I start an admin. Konsole and try 'ruby unison.rb' I get the same result. Checking the permissions on the ruby binary (I compiled this myself), it's clearly owned by root. It runs just fine from my normal user acct.
So, why doesn't root know about it? What do I need to do to get this simple thing to run? I'm out of ideas at this point. (Yeah, I know I could be using a bash script to do this, but I don't know bash, and this is very easy to set up in ruby...if it would run.)
Any help would be gratefully received.
t.
I program exclusively in Ruby. I want to execute a Unison script which is run from within a Ruby program, then turn off my computer. The Unison thing simply matches up my on-board HD with an external USB HD I use on another machine. It runs for a while, then I want my computer to shutdown. I'm using the 'shutdown' command to effect that. The idea is to set this running and go to bed. A few minutes later it's done and the computer is off.
"Shutdown' must be run from my admin. acct., of course. But when I enter 'sudo ruby unison.rb' (that's the name of my ruby script), I'm told that Ruby isn't installed. When I start an admin. Konsole and try 'ruby unison.rb' I get the same result. Checking the permissions on the ruby binary (I compiled this myself), it's clearly owned by root. It runs just fine from my normal user acct.
So, why doesn't root know about it? What do I need to do to get this simple thing to run? I'm out of ideas at this point. (Yeah, I know I could be using a bash script to do this, but I don't know bash, and this is very easy to set up in ruby...if it would run.)
Any help would be gratefully received.
t.
Comment