Installing newer Ruby on a shared webserver

My webhost currently has 1.6.8 installed, along with eRuby, mod_ruby and all (on OpenBSD). I've been told it's possible to install 1.8.2, and I've already compiled it, but I have no idea where to put it and what to modify in order to continue using it the same way I used 1.6.8.

Any tips or pointers would be appreciated.

Your ISP would be the one required to place it globally -- that would
be what's required for mod_ruby. However, if you do something like:

  ./configure --prefix=${HOME}
  make
  make install

You'll install it in ${HOME}/bin, etc.

-austin

···

On Fri, 13 Aug 2004 11:21:09 +0900, Chris Dutton <rubyguru@hotmail.com> wrote:

My webhost currently has 1.6.8 installed, along with eRuby, mod_ruby and
all (on OpenBSD). I've been told it's possible to install 1.8.2, and
I've already compiled it, but I have no idea where to put it and what to
modify in order to continue using it the same way I used 1.6.8.

Any tips or pointers would be appreciated.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Chris,

It's unlikely that your webhost will let you install a newer version
of mod_ruby, as the Apache configuration is usually done per-server,
rather than per-client. Aside from that, though, you should be able to
configure and build a new ruby install anywhere inside your home
directory tree. Just use the
'--prefix=/home/<yourusername>/<someinstalldir>' argument to the
configure script, make, and make install (without doing an su to
root).

You will have to update the #! line in your CGI scripts to point to
your Ruby interpreter instead of the system one, but after that, you
should have it.

Alternately, if you really want the 1.8 functionality inside mod_ruby,
you should take a look at the 'shim' library, which provides the bits
that were added in 1.8 to a 1.6.X installation as an extension.

Hope that helps,

Lennon

Lennon Day-Reynolds wrote:

Chris,

It's unlikely that your webhost will let you install a newer version
of mod_ruby, as the Apache configuration is usually done per-server,
rather than per-client. Aside from that, though, you should be able to
configure and build a new ruby install anywhere inside your home
directory tree. Just use the
'--prefix=/home/<yourusername>/<someinstalldir>' argument to the
configure script, make, and make install (without doing an su to
root).

Thanks. That's pretty much the answer I got from them, eventually.

Will it still be possible for me to get Rails running with this configuration?

Will it still be possible for me to get Rails running with this configuration?

You can easily run Rails in CGI-mode like this, but that's not really suitable for a high-load production site. If you're running with Apache, you want either mod_ruby or FastCGI. The latter sounds more likely in the event of a shared host, but in my experience I've still had to reboot Apache some times to get FCGI back. So...

If you're allowed to open ports, even just internally, you can use WEBrick. So imagine you start your Rails application on port 3000, then you can do:

<VirtualHost *>
    ServerName my.rails.com
    ProxyPass / http://127.0.0.1:3000/
    ProxyPassReverse / http://127.0.0.1:3000/
</VirtualHost>

And have port 80 calls to my.rails.com forwarded to the app running on port 3000 internally.

···

--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services