A Way to Keep update Ruby version 2) install rbenv
To update Ruby version, firstly I update RVM and then, found some article about rbenv. https://github.com/sstephenson/rbenv
With rbenv, change ruby version easily. Sounds nice. Since I always check the other people’s code to learn.
Before install rbenv, need to uninstall RVM. 1. $ rvm implode (some article says: $ rvm seppuku) Seppuku!?
2. rvm asks for re-confirm for uninstall. type “yes”
3. Then, below comment is appeared:
“Note you may need to manually remove /etc/rvmrc and ~/.rvmrc if they exist still.
Please check all .bashrc .bash_profile .profile and .zshrc for RVM source lines and delete or comment out if this was a Per-User installation.
Also make sure to remove `rvm` group if this was a system installation.
Finally it might help to relogin / restart if you want to have fresh environment (like for installing RVM again).”
Open text editor (I use sublime text to delete all .bashrc .bash_profile .profile and .zshrc for RVM source lines).
Also, do: $ rm -rf .rvm $ rm -rf ./etc/rvmrc to remove RVM files.
Now, all RVM related files, lines were removed.
4. Install rbenv using brew $ brew update (just in case. I already update/upgrade all brew before) $ brew install rbenv ruby-build $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile (this command create path.) $ rbenv install -l (check ruby install list) $ rbenv install 2.2.3 (this is the current stable version) 5. To set default ruby version $ rbenv global 2.2.3 (set version 2.2.3 as default version)
6. To back system default to default $ rbenv global system (back to system default 2.0.0)
7. To set a specific version to the local directory Under the local directory: $ rbenv local 1.9.3-p448
To unset local setting: $ rbenv local --unset
8. Uninstall ruby $ rbenv uninstall 1.9.3-p448
9. rehash plug-in When instal new version of Ruby or gem package, rbenv require the command of “$ rbenv rehash”. This is too much to do every time.
$ gem install rbenv-rehash $ rbenv rehash (after install gem, only 1 time to do rehash)
or install plug-in $ git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash This plug in automatically do “rbenv rehash”!
Reference:
https://github.com/sstephenson/ruby-build#readme https://mattbrictson.com/rails-osx-setup-guide
http://niwatako.tips/20140819/article128.html (Japanese) http://easyramble.com/change-ruby-manager-from-rvm-to-rbenv.html(Japanese) http://niwatako.tips/20140819/article128.html(Japanese)







