0

Does anyone have a good guide to installing ruby 1.9.3 on Ubuntu that does use RVM? I have been developing in 1.8.7 for about a year, and am wanting to ugprade to 1.9.x.

After spending countless hours trying to install 1.9, I reached a point of frustration/complexity that I did not want to replicate on my four production servers.

After my failed attempt to get 1.9 working with Aptana Studio, I removed it, but that left a bunch of scripts in /usr/local/bin still referencing ruby 1.9.

Is this a mess? Or does it just feel like a mess because I am a newb?

thanks

vanboom
  • 1,274
  • 12
  • 20

2 Answers2

1

Can you be specific about what problems you are having in installing Ruby 1.9.3? I have installed it on my Linux Mint system (Ubuntu-based) both using rvm and from source, without having any problems either way.

Ruby is slightly Unix-biased -- you are more likely to have problems installing on Windows than on Linux. Installing Ruby on Ubuntu is generally a smooth experience.

Alex D
  • 29,755
  • 7
  • 80
  • 126
  • I never had problems installing ruby using rvm neither on debian nor on Ubuntu. – PragTob Nov 12 '12 at 16:19
  • Today I installed 1.9 on a fresh install of Ubuntu Server 12.04 - and it went rather smoothly. On my development Ubuntu 12.04 machine, I am trying to upgrade from ruby 1.8.7 to 1.9.3 which seems to be a mess as I found duplicate scripts in /usr/bin and /usr/local/bin. I am not wanting to use RVM because I would like to move UP and have no need to switch ruby versions. So I am looking for the "apt-get install" steps to install 1.9.3 which will leave me with a clean and tidy 1.9.3 development environment w/ ruby-debug-ide19, ruby-debug19, etc. Just could not get all that sorted out. – vanboom Nov 12 '12 at 18:06
  • Although right now you think you have no need to switch Ruby versions, things can and will change in ways you don't expect. So it's still not a bad idea to use `rvm`, just in case. If you really don't want to use `rvm`, you're better off installing Ruby from source, rather than using `apt-get` (in my experience, the Ruby package for `apt-get` is usually very out-of-date). There are instructions on http://ruby-lang.org/, which are quite simple and easy to follow. If you try and it's still not working, please post the exact error messages (or a description of what's not working) here. – Alex D Nov 13 '12 at 04:47
0

I regularly install Ruby from source on CentOS hosts, and if there was going to be a problem it'd be there.

Ruby 1.9+ installs easily. Typically I'll install a standard Ruby using a distribution for Centos, which loads all the prerequisites, then will install 1.9+ into /usr/local/bin using the standard make.

Otherwise, since you've used RVM, ask it what prerequisites you need, then install them from your package manager, and compile Ruby from source.

Here's a little shell script I wrote to speed up the process for some of our boxes:

#!/bin/sh

echo "Installing Ruby's prerequisites"
sudo yum install -y gcc-c++ patch readline-devel readline zlib-devel zlib libyaml-devel libffi-devel openssl-devel iconv-devel

echo "Installing Nokogiri's prerequisites"
sudo yum install -y ruby-devel libxml2-devel libxml2 libxslt-devel libxslt 

echo "Installing MySQL/Sequel's development prerequisites"
sudo yum install -y mysql-devel freetds-devel freetds

echo "Now install Ruby from http://www.ruby-lang.org/en/downloads/ then run..."
echo sudo gem install \
amqp \
awesome_print \
bunny \
colors \
columnize \
debugger \
highline \
ipaddress \
irbtools \
mysql2 \
net-scp \
net-sftp \
net-ssh \
netaddr \
nokogiri \
pry \
rails \
sequel \
sinatra \
tiny_tds \
the Tin Man
  • 158,662
  • 42
  • 215
  • 303