Ruby: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 13: Line 13:
\curl -L https://get.rvm.io | bash -s stable
\curl -L https://get.rvm.io | bash -s stable
source ~/.bash_profile
source ~/.bash_profile
rvm install ruby-2.1.4
time rvm install ruby-2.1.4
</pre>
The last step will take a while since no binary rubies for my OS/architecture were available and it has to compile Ruby from the source. At the end of installing, it will show
<pre>
Install of ruby-2.1.4 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
</pre>
</pre>
The last step will take a while since no binary rubies were available and it has to compile Ruby from source.


Then check ruby versions installed and in use
Then check ruby versions installed and in use
<pre>
<pre>
which rvm
# /home/brb/.rvm/bin/rvm
ruby -v
# ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
rvm list
rvm list
rvm use --default ruby-2.1.4
rvm use --default ruby-2.1.4

Revision as of 16:27, 13 March 2015

Installation on Ubuntu

http://stackoverflow.com/questions/26595620/how-to-install-ruby-2-1-4-on-ubuntu-14-04 mentioned a couple of methods.

sudo apt-get update
sudo apt-get install build-essential make curl
\curl -L https://get.rvm.io | bash -s stable
source ~/.bash_profile
time rvm install ruby-2.1.4

The last step will take a while since no binary rubies for my OS/architecture were available and it has to compile Ruby from the source. At the end of installing, it will show

Install of ruby-2.1.4 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

Then check ruby versions installed and in use

which rvm
# /home/brb/.rvm/bin/rvm
ruby -v
# ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
rvm list
rvm use --default ruby-2.1.4

Documentation

https://www.ruby-lang.org/en/documentation/