Skip to content

Instantly share code, notes, and snippets.

@dcht00
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcht00/20f7b95ed1324fd6fc85 to your computer and use it in GitHub Desktop.
Save dcht00/20f7b95ed1324fd6fc85 to your computer and use it in GitHub Desktop.
Ruby 2.0 on Ubuntu 14.04 (Messy notes)
#
# Ruby2.0 on Ubuntu 14.04
# COPY-PASTE OF NOTES
#
# As seen on
# https://github.com/brightbox/deb-ruby2.0/issues/1
#
# <dcht00
# September 2014
#
# /HOME = /~
#
################# I've used other people's stuff
################# might or might not be properly linked
################# or properly working
################# but these notes eventually got the job done. Here goes
INSTALL RUBY2.0 ON UBUNTU 14.04
Problematic, ver 1.9 is default
(14.04 is LTS, so this bs will stay for a while)
more on this:
https://bugs.launchpad.net/ubuntu/+source/ruby2.0/+bug/1310292
https://bugs.launchpad.net/ubuntu/+source/ruby-defaults/+bug/1315143
-------------------
I USED THIS BUT NOT SURE IF IT WORKED COMPLETELY / I THINK BECAUSE OF MY SPECIFIC ENV ?
"""
#!/bin/bash
cowsay "one"
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
cowsay "two"
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
cowsay "three"
rbenv install 2.1.2
rbenv global 2.1.2
ruby -v
####
#### <dcht00
#### I disabled this because I like local docs
####
#The last step is to tell Rubygems not to install the documentation for each package locally
#echo "gem: --no-ri --no-rdoc" > ~/.gemrc
"""
------------------
via
https://gorails.com/setup/ubuntu/14.04
http://askubuntu.com/questions/368572/how-to-install-ruby
Installed ruby-2.1.2 to /HOME/.rbenv/versions/2.1.2
$ apt-get install ruby2.0 ruby2.0-dev
### Not sure what this contributes next to the rbenv one...
"""
x@y:/HOME/.rbenv/versions/2.1.2$ ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
x@y:/HOME/.rbenv/versions/2.1.2$ ruby2.0 --version
ruby 2.0.0p384 (2014-01-12) [x86_64-linux-gnu]
"""
#
#
# LINK IT BY DEFAULT
#
#
'update-alternatives' didn't work
So do it by hand !!!!!!!!!!!!!!!!
cd /usr/bin
sudo mv ruby ruby_old
sudo ln -s ruby2.0 ruby
sudo mv gem gem_old
sudo ln -s gem2.0 gem
this is a good overview:
http://stackoverflow.com/questions/23493984/how-to-install-ruby-2-and-ruby-gems-on-ubuntu-box-with-ansible
####################
Where does ruby lead now?
x@y:/usr/bin$ which -a ruby
/HOME/.rbenv/shims/ruby
/usr/bin/ruby
x@y:/usr/bin$ ll /usr/bin/ruby
lrwxrwxrwx 1 root root 7 Sep 9 15:19 /usr/bin/ruby -> ruby2.0*
@jphager2
Copy link

Thanks for the notes! Interesting method

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