From: James Britt Date: 2005-02-17T14:07:46+09:00 Subject: Re: installed ruby on linux without su access Eko Budi Setiyo wrote: > James Britt wrote: > >> Eko Budi Setiyo wrote: >> >>> Hi all, >>> >>> Beside http://www.rubygarden.org/ruby?RubyWithoutRoot >>> is there any tutorial to help me really install ruby on linux without >>> root access. >>> I am trying to installed it on hosting company where I host my website. >> >> >> >> What sort of access do you have? telnet? ssh? ftp? >> >> I've had success compiling Ruby (including running autoconf) on a >> remote hosting site where all I had was ftp and http access; I wrote >> perl and php scripts, called them through a Web page, and ended up >> with ruby installed under my home dir. >> >> Life got better after that. >> >> >> >> James >> >> >> > I have fpt,ssh and of coruse http access. Do you mind share your way to us. If you have ssh, you're in like Flynn. The only trick is that you have to tell ./configure to install the binaries into your home dir (--prefix=$HOME/ruby or something like that). For those with only ftp/http (as I've been asked this before) FTP up the ruby tarball and some perl/php scripts. The perl/php needs to call system() or exec() or whatever it is called to shell out and: Extract the tarball to a nice home run ./configure in the ruby source dir run make run make test run make install Very important: the call to 'configure' *must* pass the config options to put the binaries under $HOME/ruby or something similar. Otherwise it tries to go to /usr/local/ and that will fail. (I don't have a 'nix system handy to tell you exactly what these are. I think its --prefix=$HOME/ruby or some such thing. Run ./configure --help to be sure. Or Google for it.) Tip for the Perl code: use carp, which is a lib for getting nice CGI errors logged for you. It can be tricky to get each step right, and tracking down goofy CGI and syntax errors can get annoying. Code will probably need to either cd to the installation dir before running specific commands, or make all system calls using full paths. You also have to check what permissions are set on files. You may end up with files owned by www or apache or something, so have the perl/php code call chmod and chown along the way. Sorry the details are so vague; I did this about 4 years ago and never really kept track of the scripts I wrote to do this. But either perl or PHP will do, as they both allow shell calls and writing messages back to the browser. They're pretty useful for stuff like that. If you want to be clever you could probably just write a form that takes a string and executes it via a system() call. Then just pass in each command you need. Just don't name it index.php. And your Ruby code will need to use the correct path (i.e. not /usr/local/bin/ruby) to your ruby binaries once you are up and running. James