installed ruby on linux without su access

J

James Britt

Eko said:
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
 
E

Eko Budi Setiyo

James said:
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.

regards
Eko
 
E

Eko Budi Setiyo

James said:
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
One more, I don't use Perly, but PHP is my other language beside Ruby.
The hosting already installe ruby 1.65 but the said they don't support
ruby 1.8x currently. So I need to do it my self.

regards
Eko
 
J

James Britt

Eko said:
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
 
E

Eko Budi Setiyo

James said:
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).

I tried, but get the following error
----------------------------------------------------------------------------------------------------------
[ekobudi@spruce ruby-1.8.2]$ configure --prefix=/home/ekobudi/stow/ruby
bash: configure: command not found
[ekobudi@spruce ruby-1.8.2]$ ./configure --prefix=/home/ekobudi/stow/ruby
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C
compiler cannot create executables
See `config.log' for more details.
[ekobudi@spruce ruby-1.8.2]$
---------------------------------------------------------------------------------------------------------

any idea what should I do.

regards
Eko
 
M

Mark Probert

Hi ..

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.

So, this is pretty straight forward:

1. get the tar ball (ruby-1.8.2.tar.gz)

2. unbundle it ($ tar zxf ruby-1.8.2.tar.gz)

3. run configure using --prefix

$ ./configure --prefix=/my/dest/dir

4. make

5. make install

And you are done. There are three directories under /my/dest/dir

bin -- add this to your path
lib
etc

then test it with

$ rehash (assuming the shell)
$ which ruby
$ ruby -v

I hope this helps.

Regards,
 
E

Eko Budi Setiyo

Mark said:
Hi ..



So, this is pretty straight forward:

1. get the tar ball (ruby-1.8.2.tar.gz)

2. unbundle it ($ tar zxf ruby-1.8.2.tar.gz)

3. run configure using --prefix

$ ./configure --prefix=/my/dest/dir

4. make

5. make install

And you are done. There are three directories under /my/dest/dir

bin -- add this to your path
lib
etc

then test it with

$ rehash (assuming the shell)
$ which ruby
$ ruby -v

I hope this helps.

Regards,
I get error on step 3

Here is the errror
################################################################################
[ekobudi@spruce ruby-1.8.2]$ ./configure --prefix=/home/ekobudi/stow/ruby
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C
compiler cannot create executables
See `config.log' for more details.
[ekobudi@spruce ruby-1.8.2]$
 
G

Gennady Bystritsky

It may be so that your provider has the filesystem where your home
reside mounted with noexec option. You can check it by creating a
simple shell script in your home and trying chmod a+x on it. If it does
not make the script executable, then you are doomed. Potentially, you
could try their /tmp directory if it allows executable files and if it
does, build ruby there by something like:

$ mkdir /tmp/dir_for_ruby_build

$ cd /tmp/dir_for_ruby_build
$ ${HOME}/dir_with_ruby_source/configure --prefix ${HOME}/ruby
...
$ make
...
$ make install

In this case you will have to create a launcher script, say ruby.sh,
that you will call with "sh ruby.sh". It will copy
${HOME}/ruby/bin/ruby to /tmp, chmod a+x on it and then exec.

Gennady.

James said:
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).

I tried, but get the following error
-----------------------------------------------------------------------
-----------------------------------
[ekobudi@spruce ruby-1.8.2]$ configure --prefix=/home/ekobudi/stow/ruby
bash: configure: command not found
[ekobudi@spruce ruby-1.8.2]$ ./configure
--prefix=/home/ekobudi/stow/ruby
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... configure: error:
C compiler cannot create executables
See `config.log' for more details.
[ekobudi@spruce ruby-1.8.2]$
-----------------------------------------------------------------------
----------------------------------

any idea what should I do.

regards
Eko
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

Sincerely,
Gennady Bystritsky
 
M

martinus

compiler cannot create executables

I guess you cannot do anything about this, thats a limitation enforced
by your provider. Either the provider allows excutables, switches to
ruby 1.8.x, or you switch the provider...

martinus
 
A

Alexander Kellett

Here is the errror
#######################################################################
#########
[ekobudi@spruce ruby-1.8.2]$ ./configure
--prefix=/home/ekobudi/stow/ruby
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... configure: error:
C compiler cannot create executables
See `config.log' for more details.
[ekobudi@spruce ruby-1.8.2]$

find out what the providers running. install it. build. copy.

Alex
 
N

Navindra Umanee

Eko Budi Setiyo said:
checking for C compiler default output file name... configure: error: C
compiler cannot create executables
See `config.log' for more details.

How much long are you going to read that output, paste that output,
before looking for more details in config.log?

The suspense is killing me here... I was really hoping you'd tell us
about the juicy error information in config.log! ;-)

Cheers,
Navin.
 
E

Eko Budi Setiyo

--------------090502020805000109090207
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Navindra said:
How much long are you going to read that output, paste that output,
before looking for more details in config.log?

The suspense is killing me here... I was really hoping you'd tell us
about the juicy error information in config.log! ;-)

Cheers,
Navin.
Sory for that :D

Here is from the config.log

####################################

[ekobudi@spruce ruby-1.8.2]$ vi config.log


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1402: checking build system type
configure:1420: result: i686-pc-linux-gnu
configure:1428: checking host system type
configure:1442: result: i686-pc-linux-gnu
configure:1450: checking target system type
configure:1464: result: i686-pc-linux-gnu
configure:1691: checking for gcc
configure:1707: found /usr/bin/gcc
configure:1717: result: gcc
configure:1961: checking for C compiler version
configure:1964: gcc --version </dev/null >&5
/configure: /usr/bin/gcc: Permission denied
configure:1967: $? = 126
configure:1969: gcc -v </dev/null >&5
/configure: /usr/bin/gcc: Permission denied
configure:1972: $? = 126
configure:1974: gcc -V </dev/null >&5
"config.log" 251L, 5126C
46,1 14%

#########################################################

Any suggestion

regards
Eko

--------------090502020805000109090207--
 
D

David Garamond

Eko said:
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.

Someone will eventually suggest this, so it might as well be me.

Consider asking your provider to install Ruby, or consider switching
provider. Ruby should be there by default on a growing number of Linux
distributions (like Debian) as many tools are now written in Ruby.
 
M

Mark Probert

Hi ..

configure:1707: found /usr/bin/gcc
configure:1717: result: gcc
configure:1961: checking for C compiler version
configure:1964: gcc --version </dev/null >&5
./configure: /usr/bin/gcc: Permission denied

Any suggestion
Get the sysadmin to change the permissions on gcc. 755 may be suitable ...
 
E

Erik Veenstra

Beside http://www.rubygarden.org/ruby?RubyWithoutRoot is
there any tutorial to help me really install ruby on linux
without root access.

If you run Linux on your machine, you might want to use
AllInOneRuby [1] to create allinoneruby.bin, which is a big
binary embedding the Ruby interpreter and the runtime
environment, and copy this file to the machine of your
provider. I've done this several times. Works flawlessly as
long as your GCC-version isn't newer than the one of your
provider...

In one xterm:

$ ruby allinoneruby.rb
Stripping...
Creating allinoneruby.bin ...
$ tar c allinoneruby.bin | nc -l -p 1234

In another xterm:

$ ssh (e-mail address removed) -R 1234:localhost:1234
(e-mail address removed)'s password:
(e-mail address removed):~> nc localhost 1234 | tar x
(e-mail address removed):~> echo "p 1234" > test.rb
(e-mail address removed):~> ./allinoneruby.bin test.rb
1234

That's how I do this. No installation, no admin things. Just
one Ruby executable.

gegroet,
Erik V.

[1] http://www.erikveen.dds.nl/allinoneruby/index.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,915
Members
47,456
Latest member
JavierWalp

Latest Threads

Top