Friday, March 16, 2018

How to install rbenv and Ruby build


rbenv use to setup different ruby environment based on your application, it's a nifty tool for development environment especially if your working different Ruby applications.


Installing instruction for rbenv
$ brew install rbenv
Add rbenv's bin path into .rc(.bash_profile) file
export PATH="$HOME/.rbenv/bin:$PATH" 
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
Make sure you have reloaded terminal with env changes

Installing specific Ruby version Ex. 2.3.4
$ rbenv install 2.3.4

ruby-build: use openssl from homebrew
Downloading ruby-2.3.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.3.4.tar.bz2


Installing ruby-2.3.4...


Installed ruby-2.3.4 to /Users/home/.rbenv/versions/2.3.4

Make your Ruby 2.3.4 as global 
$ rbenv global 2.3.4
$ ruby -v
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin17]
Sets the global version of Ruby to be used in all shells by writing the version name to the ~/.rbenv/version file. This version can be overridden by an application-specific .ruby-version file, or by setting the RBENV_VERSION environment variable.

No comments:

Post a Comment