Hello World

Be Happy!

when not changed rbenv local


Install

% rbenv install 3.0.0
Downloading openssl-1.1.1i.tar.gz...

But ruby -v showed 2.6.3

% rbenv local 3.0.0
% rbenv local      
3.0.0
% ruby -v           
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

Failed gem install

% gem install bundler
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

Solution

% env | grep PATH                     
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

# add below code to ~/.bash_profile
# add below code to .zprofile (mac os use zsh with .zprofile instead of bash with .bash_profile)
# https://github.com/rbenv/rbenv
vim ~/.zprofile
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)"

# https://github.com/rbenv/rbenv/issues/1267
export GEM_HOME="$HOME/.gem"

% env | grep PATH                     
PATH=/Users/xxxx/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
#ruby (13) #rbenv (1) #rehash (1)
List