I would like to install the newest ruby and rails on my debian lenny server.
I found the package http://packages.debian.org/lenny-backports/ruby1.9.1-full but when I try to install it with I just get:
atlas:~# apt-get install ruby1.9.1-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ruby1.9.1-full
My sources.list looks like this:
atlas:~# cat /etc/apt/sources.list
deb http://ftp.se.debian.org/debian/ lenny main non-free contrib
deb-src http://ftp.se.debian.org/debian/ lenny main non-free contrib
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
What do I have to do to get it installed?
Stop. Go back. Install whatever version of Ruby Debian has, probably 1.8.7 or 1.8.7. Then install RVM. I have some directions for using RVM with Ubuntu (sorry, not Debian, but it’s close). Seriously, RVM makes installing any version of Ruby easy. Then, use RVM to install Ruby 1.9.2, you don’t want 1.9.1.
This will work depending on what you want to use Ruby for. For development purposes, using RVM works really well. For server purposes, I suppose it can be used, but you might have some problems. I think RVM gives you some scripts you can use to run Ruby scripts with init scripts and cron jobs.
Or, you can just install from source. It’s not hard, and it’s not the debian way, but it’ll get the job done. This may be preferable to installing some third party packages, where you may have no idea what they did during compile time, and how to get speedy updates in the case of a security vulnerability. Using RVM or installing manually from source, you can update whenever it’s needed.