Howto install or upgrade Ruby 2 on Ubuntu Debian

Howto install or upgrade Ruby 2 on Ubuntu Debian

 

root@ubuntu:/etc/sensu/conf.d# sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev


Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version.
zlib1g-dev is already the newest version.
zlib1g-dev set to manually installed.
curl is already the newest version.
The following extra packages will be installed:
comerr-dev krb5-multidev libgcrypt11-dev libgnutls-dev libgnutlsxx27
libgpg-error-dev libgssrpc4 libidn11-dev libkadm5clnt-mit9 libkadm5srv-mit9
libkdb5-7 libkrb5-dev libldap2-dev libp11-kit-dev libreadline6-dev
librtmp-dev libssl-doc libtasn1-6-dev libtinfo-dev pkg-config python-pycurl
Suggested packages:
doc-base krb5-doc libcurl4-doc libcurl3-dbg libgcrypt11-doc gnutls26-doc
gnutls-bin krb5-user sqlite3-doc libcurl4-gnutls-dev python-pycurl-dbg
The following NEW packages will be installed:
comerr-dev git-core krb5-multidev libcurl4-openssl-dev libffi-dev
libgcrypt11-dev libgnutls-dev libgnutlsxx27 libgpg-error-dev libgssrpc4
libidn11-dev libkadm5clnt-mit9 libkadm5srv-mit9 libkdb5-7 libkrb5-dev
libldap2-dev libp11-kit-dev libreadline-dev libreadline6-dev librtmp-dev
libsqlite3-dev libssl-dev libssl-doc libtasn1-6-dev libtinfo-dev libxml2-dev
libxslt1-dev libyaml-dev pkg-config python-pycurl python-software-properties
sqlite3
0 upgraded, 32 newly installed, 0 to remove and 3 not upgraded.
Need to get 6,545 kB of archives.
After this operation, 24.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libgssrpc4 i386 1
Get:2 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libkadm5clnt-mit9
Get:3 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libkdb5-7 i386 1. 12+dfsg-2ubuntu5.2 [36.1 kB]
Get:4 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libkadm5srv-mit9 i386 1.12+dfsg-2ubuntu5.2 [49.9 kB]
Get:5 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libgnutlsxx27 i386 2.12.23-12ubuntu2.5 [17.9 kB]
Get:6 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main git-core all 1:1.9.1-1ubuntu0.3 [1,464 B]
Get:7 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main comerr-dev i386 2.1-1.42.9-3ubuntu1.3 [37.9 kB]
Get:8 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main krb5-multidev i386 1.12+dfsg-2ubuntu5.2 [111 kB]
Get:9 http://gb.archive.ubuntu.com/ubuntu/ trusty/main pkg-config i386 0.26-1ubuntu4 [40.5 kB]
Get:10 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libidn11-dev i386 1.28-1ubuntu2.1 [520 kB]
Get:11 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libkrb5-dev i386 1.12+dfsg-2ubuntu5.2 [14.4 kB]
Get:12 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libldap2-dev i386 2.4.31-1+nmu2ubuntu8.3 [259 kB]
Get:13 http://gb.archive.ubuntu.com/ubuntu/ trusty/main libgpg-error-dev i386 1.12-0.2ubuntu1 [19.8 kB]
Get:14 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libgcrypt11-dev i386 1.5.3-2ubuntu4.4 [277 kB]
Get:15 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libtasn1-6-dev i386 3.4-3ubuntu0.4 [383 kB]
Get:16 http://gb.archive.ubuntu.com/ubuntu/ trusty/main libp11-kit-dev i386 0.20.2-2ubuntu2 [56.5 kB]
Get:17 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libgnutls-dev i386 2.12.23-12ubuntu2.5 [369 kB]
Get:18 http://gb.archive.ubuntu.com/ubuntu/ trusty/main librtmp-dev i386 2.4+20121230.gitdf6c518-1 [66.1 kB]
Get:19 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libssl-dev i386 1.0.1f-1ubuntu2.21 [994 kB]
Get:20 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libcurl4-openssl-dev i386 7.35.0-1ubuntu2.9 [231 kB]
Get:21 http://gb.archive.ubuntu.com/ubuntu/ trusty/main libtinfo-dev i386 5.9+20140118-1ubuntu1 [71.2 kB]
Get:22 http://gb.archive.ubuntu.com/ubuntu/ trusty/main libreadline6-dev i386 6.3-4ubuntu2 [207 kB]
Get:23 http://gb.archive.ubuntu.com/ubuntu/ trusty/main libreadline-dev i386 6.3-4ubuntu2 [988 B]
Get:24 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libsqlite3-dev i386 3.8.2-1ubuntu2.1 [442 kB]
Get:25 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libssl-doc all 1.0.1f-1ubuntu2.21 [971 kB]
Get:26 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libxml2-dev i386 2.9.1+dfsg1-3ubuntu4.8 [629 kB]
Get:27 http://gb.archive.ubuntu.com/ubuntu/ trusty/main libxslt1-dev i386 1.1.28-2build1 [405 kB]
Get:28 http://gb.archive.ubuntu.com/ubuntu/ trusty/main python-pycurl i386 7.19.3-0ubuntu3 [46.9 kB]
Get:29 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/universe python-software-properties all 0.92.37.7 [19.6 kB]
Get:30 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main sqlite3 i386 3.8.2-1ubuntu2.1 [28.3 kB]
Get:31 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libffi-dev i386 3.1~rc1+r3.0.13-12ubuntu0.1 [98.9 kB]
Get:32 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main libyaml-dev i386 0.1.4-3ubuntu3.1 [53.2 kB]
Fetched 6,545 kB in 58s (111 kB/s)
Extracting templates from packages: 100%
Selecting previously unselected package libgssrpc4:i386.
(Reading database … 78110 files and directories currently installed.)
Preparing to unpack …/libgssrpc4_1.12+dfsg-2ubuntu5.2_i386.deb …
Unpacking libgssrpc4:i386 (1.12+dfsg-2ubuntu5.2) …
Selecting previously unselected package libkadm5clnt-mit9:i386.
Preparing to unpack …/libkadm5clnt-mit9_1.12+dfsg-2ubuntu5.2_i386.deb …
Unpacking libkadm5clnt-mit9:i386 (1.12+dfsg-2ubuntu5.2) …
Selecting previously unselected package libkdb5-7:i386.
Preparing to unpack …/libkdb5-7_1.12+dfsg-2ubuntu5.2_i386.deb …
Unpacking libkdb5-7:i386 (1.12+dfsg-2ubuntu5.2) …
Selecting previously unselected package libkadm5srv-mit9:i386.
Preparing to unpack …/libkadm5srv-mit9_1.12+dfsg-2ubuntu5.2_i386.deb …
Unpacking libkadm5srv-mit9:i386 (1.12+dfsg-2ubuntu5.2) …
Selecting previously unselected package libgnutlsxx27:i386.
Preparing to unpack …/libgnutlsxx27_2.12.23-12ubuntu2.5_i386.deb …
Unpacking libgnutlsxx27:i386 (2.12.23-12ubuntu2.5) …
Selecting previously unselected package git-core.
Preparing to unpack …/git-core_1%3a1.9.1-1ubuntu0.3_all.deb …
Unpacking git-core (1:1.9.1-1ubuntu0.3) …
Selecting previously unselected package comerr-dev.
Preparing to unpack …/comerr-dev_2.1-1.42.9-3ubuntu1.3_i386.deb …
Unpacking comerr-dev (2.1-1.42.9-3ubuntu1.3) …
Selecting previously unselected package krb5-multidev.
Preparing to unpack …/krb5-multidev_1.12+dfsg-2ubuntu5.2_i386.deb …
Unpacking krb5-multidev (1.12+dfsg-2ubuntu5.2) …
Selecting previously unselected package pkg-config.
Preparing to unpack …/pkg-config_0.26-1ubuntu4_i386.deb …
Unpacking pkg-config (0.26-1ubuntu4) …
Selecting previously unselected package libidn11-dev.
Preparing to unpack …/libidn11-dev_1.28-1ubuntu2.1_i386.deb …
Unpacking libidn11-dev (1.28-1ubuntu2.1) …
Selecting previously unselected package libkrb5-dev.
Preparing to unpack …/libkrb5-dev_1.12+dfsg-2ubuntu5.2_i386.deb …
Unpacking libkrb5-dev (1.12+dfsg-2ubuntu5.2) …
Selecting previously unselected package libldap2-dev:i386.
Preparing to unpack …/libldap2-dev_2.4.31-1+nmu2ubuntu8.3_i386.deb …
Unpacking libldap2-dev:i386 (2.4.31-1+nmu2ubuntu8.3) …
Selecting previously unselected package libgpg-error-dev.
Preparing to unpack …/libgpg-error-dev_1.12-0.2ubuntu1_i386.deb …
Unpacking libgpg-error-dev (1.12-0.2ubuntu1) …
Selecting previously unselected package libgcrypt11-dev.
Preparing to unpack …/libgcrypt11-dev_1.5.3-2ubuntu4.4_i386.deb …
Unpacking libgcrypt11-dev (1.5.3-2ubuntu4.4) …
Selecting previously unselected package libtasn1-6-dev.
Preparing to unpack …/libtasn1-6-dev_3.4-3ubuntu0.4_i386.deb …
Unpacking libtasn1-6-dev (3.4-3ubuntu0.4) …
Selecting previously unselected package libp11-kit-dev.
Preparing to unpack …/libp11-kit-dev_0.20.2-2ubuntu2_i386.deb …
Unpacking libp11-kit-dev (0.20.2-2ubuntu2) …
Selecting previously unselected package libgnutls-dev.
Preparing to unpack …/libgnutls-dev_2.12.23-12ubuntu2.5_i386.deb …
Unpacking libgnutls-dev (2.12.23-12ubuntu2.5) …
Selecting previously unselected package librtmp-dev.
Preparing to unpack …/librtmp-dev_2.4+20121230.gitdf6c518-1_i386.deb …
Unpacking librtmp-dev (2.4+20121230.gitdf6c518-1) …
Selecting previously unselected package libssl-dev:i386.
Preparing to unpack …/libssl-dev_1.0.1f-1ubuntu2.21_i386.deb …
Unpacking libssl-dev:i386 (1.0.1f-1ubuntu2.21) …
Selecting previously unselected package libcurl4-openssl-dev:i386.
Preparing to unpack …/libcurl4-openssl-dev_7.35.0-1ubuntu2.9_i386.deb …
Unpacking libcurl4-openssl-dev:i386 (7.35.0-1ubuntu2.9) …
Selecting previously unselected package libtinfo-dev:i386.
Preparing to unpack …/libtinfo-dev_5.9+20140118-1ubuntu1_i386.deb …
Unpacking libtinfo-dev:i386 (5.9+20140118-1ubuntu1) …
Selecting previously unselected package libreadline6-dev:i386.
Preparing to unpack …/libreadline6-dev_6.3-4ubuntu2_i386.deb …
Unpacking libreadline6-dev:i386 (6.3-4ubuntu2) …
Selecting previously unselected package libreadline-dev:i386.
Preparing to unpack …/libreadline-dev_6.3-4ubuntu2_i386.deb …
Unpacking libreadline-dev:i386 (6.3-4ubuntu2) …
Selecting previously unselected package libsqlite3-dev:i386.
Preparing to unpack …/libsqlite3-dev_3.8.2-1ubuntu2.1_i386.deb …
Unpacking libsqlite3-dev:i386 (3.8.2-1ubuntu2.1) …
Selecting previously unselected package libssl-doc.
Preparing to unpack …/libssl-doc_1.0.1f-1ubuntu2.21_all.deb …
Unpacking libssl-doc (1.0.1f-1ubuntu2.21) …
Selecting previously unselected package libxml2-dev:i386.
Preparing to unpack …/libxml2-dev_2.9.1+dfsg1-3ubuntu4.8_i386.deb …
Unpacking libxml2-dev:i386 (2.9.1+dfsg1-3ubuntu4.8) …
Selecting previously unselected package libxslt1-dev:i386.
Preparing to unpack …/libxslt1-dev_1.1.28-2build1_i386.deb …
Unpacking libxslt1-dev:i386 (1.1.28-2build1) …
Selecting previously unselected package python-pycurl.
Preparing to unpack …/python-pycurl_7.19.3-0ubuntu3_i386.deb …
Unpacking python-pycurl (7.19.3-0ubuntu3) …
Selecting previously unselected package python-software-properties.
Preparing to unpack …/python-software-properties_0.92.37.7_all.deb …
Unpacking python-software-properties (0.92.37.7) …
Selecting previously unselected package sqlite3.
Preparing to unpack …/sqlite3_3.8.2-1ubuntu2.1_i386.deb …
Unpacking sqlite3 (3.8.2-1ubuntu2.1) …
Selecting previously unselected package libffi-dev:i386.
Preparing to unpack …/libffi-dev_3.1~rc1+r3.0.13-12ubuntu0.1_i386.deb …
Unpacking libffi-dev:i386 (3.1~rc1+r3.0.13-12ubuntu0.1) …
Selecting previously unselected package libyaml-dev:i386.
Preparing to unpack …/libyaml-dev_0.1.4-3ubuntu3.1_i386.deb …
Unpacking libyaml-dev:i386 (0.1.4-3ubuntu3.1) …
Processing triggers for install-info (5.2.0.dfsg.1-2) …
Processing triggers for man-db (2.6.7.1-1ubuntu1) …
Setting up libgssrpc4:i386 (1.12+dfsg-2ubuntu5.2) …
Setting up libkadm5clnt-mit9:i386 (1.12+dfsg-2ubuntu5.2) …
Setting up libkdb5-7:i386 (1.12+dfsg-2ubuntu5.2) …
Setting up libkadm5srv-mit9:i386 (1.12+dfsg-2ubuntu5.2) …
Setting up libgnutlsxx27:i386 (2.12.23-12ubuntu2.5) …
Setting up git-core (1:1.9.1-1ubuntu0.3) …
Setting up comerr-dev (2.1-1.42.9-3ubuntu1.3) …
Setting up krb5-multidev (1.12+dfsg-2ubuntu5.2) …
Setting up pkg-config (0.26-1ubuntu4) …
Setting up libidn11-dev (1.28-1ubuntu2.1) …
Setting up libkrb5-dev (1.12+dfsg-2ubuntu5.2) …
Setting up libldap2-dev:i386 (2.4.31-1+nmu2ubuntu8.3) …
Setting up libgpg-error-dev (1.12-0.2ubuntu1) …
Setting up libgcrypt11-dev (1.5.3-2ubuntu4.4) …
Setting up libtasn1-6-dev (3.4-3ubuntu0.4) …
Setting up libp11-kit-dev (0.20.2-2ubuntu2) …
Setting up libgnutls-dev (2.12.23-12ubuntu2.5) …
Setting up librtmp-dev (2.4+20121230.gitdf6c518-1) …
Setting up libssl-dev:i386 (1.0.1f-1ubuntu2.21) …
Setting up libcurl4-openssl-dev:i386 (7.35.0-1ubuntu2.9) …
Setting up libtinfo-dev:i386 (5.9+20140118-1ubuntu1) …
Setting up libreadline6-dev:i386 (6.3-4ubuntu2) …
Setting up libreadline-dev:i386 (6.3-4ubuntu2) …
Setting up libsqlite3-dev:i386 (3.8.2-1ubuntu2.1) …
Setting up libssl-doc (1.0.1f-1ubuntu2.21) …
Setting up libxml2-dev:i386 (2.9.1+dfsg1-3ubuntu4.8) …
Setting up libxslt1-dev:i386 (1.1.28-2build1) …
Setting up python-pycurl (7.19.3-0ubuntu3) …
Setting up python-software-properties (0.92.37.7) …
Setting up sqlite3 (3.8.2-1ubuntu2.1) …
Setting up libffi-dev:i386 (3.1~rc1+r3.0.13-12ubuntu0.1) …
Setting up libyaml-dev:i386 (0.1.4-3ubuntu3.1) …
Processing triggers for libc-bin (2.19-0ubuntu6.9) …

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

rbenv install 2.2.0
rbenv global 2.2.0
ruby -v

root@ubuntu:~# ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [i686-linux]
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>