Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ruby 1.9.2 on debian lenny? [closed]

Tags:

ruby

debian

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?

like image 525
Jeena Avatar asked Jan 14 '11 11:01

Jeena


2 Answers

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.

like image 101
AboutRuby Avatar answered Sep 17 '22 17:09

AboutRuby


First run this:

apt-get update

Then install Ruby

apt-get install ruby

Then you need rubygems

wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz

Untar rubygems...

tar xvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/bin/gem

Now update rubygems

gem update --system

And now we can install rails

gem install rails

You can check if the install was succesfull with the following commands:

ruby -v
rails -v
gem -v

If you need more help let me know!

If you want Ruby 1.9.2 replace the following commands:

apt-get install ruby

with

apt-get install ruby1.9

If you need the dev headers you can just install ruby1.9-dev.

apt-get install ruby1.9-dev

If you cant install them this way you need to look at your apt-get sources.

apt-cache search ruby1.9

libhtree-ruby1.9 - HTML/XML tree library for Ruby 1.9
....
libinotify-ruby1.9 - Ruby interface to Linux's inotify system
....
libdbm-ruby1.9 - DBM interface for Ruby 1.9
libgdbm-ruby1.9 - GDBM interface for Ruby 1.9
....
**ruby1.9-dev** - Header files for compiling extension modules for the Ruby 1.9
ruby1.9-elisp - ruby-mode for Emacsen
ruby1.9-examples - Examples for Ruby 1.9
**ruby1.9** - Interpreter of object-oriented scripting language Ruby 1.9
libstfl-ruby1.9 - Ruby bindings for the structured terminal forms language/library

I hope this helps.And i would suggest using RVM (but i didn't cover that here..)

like image 44
Daniël Zwijnenburg Avatar answered Sep 17 '22 17:09

Daniël Zwijnenburg