Skip to content

Instantly share code, notes, and snippets.

@ngauthier
Last active December 8, 2023 13:56
Show Gist options
  • Star 29 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
  • Save ngauthier/5039249 to your computer and use it in GitHub Desktop.
Save ngauthier/5039249 to your computer and use it in GitHub Desktop.
install ruby 2.0.0-p0 on ubuntu

Installs ruby-2.0.0-p0 on ubuntu via checkinstall so it's in your package manager and you can remove it.

Quick install:

curl -L https://gist.github.com/ngauthier/5039249/raw/1868bf4714052b40e2bb7fdf3f40fbeb5d730bca/ruby-2-install-ubuntu.sh | bash -s
#!/usr/bin/env bash
set -e
sudo apt-get build-dep ruby1.9.1
wget -c http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar xzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0
./configure
make
sudo checkinstall -y \
--pkgversion 2.0.0-p0 \
--provides "ruby-interpreter"
@pahnin
Copy link

pahnin commented Mar 1, 2013

I did this but I still get 1.9.3 when I did ruby -v!?

@kleinmat
Copy link

just in case: do a

sudo apt-get install checkinstall

before you run the script above

@rafapolo
Copy link

I got a
E: You must put some 'source' URIs in your sources.list
when
sudo apt-get build-dep ruby1.9.1

@silasdavis
Copy link

Check there are some uncommented entries in /etc/apt/sources.list beginning with 'deb-src' and/or run apt-get update

@tesfabpel
Copy link

How can I use this new package with update-alternatives?
It's not listed there when i do update-alternatives --config ruby

Thanks :-)

@jaygalligher
Copy link

Forgot to install checkinstall. Used quick install and it installed 1.8.7. Purging it.

@pije76
Copy link

pije76 commented Sep 23, 2013

Try this:
sudo add-apt-repository ppa:brightbox/ruby-ng-experimental
sudo apt-get update
sudo apt-get install -y ruby2.0 ruby2.0-dev ruby2.0-doc

Now you can do update-alternatives --config ruby

@gauravbansal74
Copy link

Thanks @pije76 :) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment