Don’t use sudo to use gem when it notices no write permissions.
1 2 3
$ gem install jekyll ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Install rbenv and ruby-build
1
$ brew install rbenv ruby-build
update and reload your appropriate dotfile for rbenv to work.