Featured image of post Using rbenv for Ruby Versions

Using rbenv for Ruby Versions

I don’t use Ruby much, but I wanted to use Jekyll for this blog. I kept getting this error when running gem install jekyll:

1
2
3
Fetching: colorator-0.1.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

I installed rbenv with brew install rbenv and added

1
[[ -s $HOME/.rbenv/bin ]] && export PATH="$HOME/.rbenv/bin:$PATH" && eval "$(rbenv init -)"

to my .bashrc file. Then I changed the default ruby interpreter from the system interpreter to one managed by rbenv with rbenv install 2.2.3 && rbenv global 2.2.3.

Last updated on Feb 26, 2024 09:22 -0500
Feedback
FOOTER