Ubuntu: Install Ruby and RubyGems with RVM #Ruby #RubyGems
Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. To install Ruby we are going to use RVM (ruby Version Manager). This installation differs from other as you don't run it with user privilegs, that means no more sudoing for this guide.
First install RVM with the latest stable release version of Ruby by fetching the RVM install script with curl.
\curl -sSL https://get.rvm.io | bash -s stable --ruby
After the installation add you current user to the rvm group.
sudo adduser [username] rmv
For the same user add the rvm startup script to the bash profile.
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
Now log out from the cli and log in to load RVM properly.
Check the installed RVM version.
As RubyGems comes as built-in extension to RVM we don't need to install it.
First let's see which is latest relase of ruby.
Download Ruby from the offical ftp server where
[version] has to replaced with the latest release.
cd /usr/local/src sudo wget http://ftp.ruby-lang.org/pub/ruby/ruby-[version].tar.gz
Untar the downloaded package.
sudo tar -xzvf ruby-[version].tar.gz sudo rm ruby-[version].tar.gz cd ruby-[version]/
sudo ./configure sudo make sudo make install
Check the Ruby version.
If everything's ok clone RubyGems from GitHub.
cd /usr/local/src sudo git clone https://github.com/rubygems/rubygems.git
And install it with Ruby.
cd rubygems/ sudo ruby setup.rb
Check the RubyGems version.