After setting up a new machine with Thoughtbot Laptop, including using the Thoughtbot dotfiles, when attempting to install a gem, I get a permissions error, however sudo works of course. I’m switching from using an RVM-based workflow to the Rbenv one, so I’m a little new at this.
Here’s my output:
$ gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/1.8 directory.
I believe this is due to the rbenv path. The error indicates that it is trying to write to the system ruby folder and not the rbenv path. You can dig through the TB Laptop script and check the steps for rbenv install and configure and run them manually to make sure you got rbenv setup correctly.
I remember struggling with this myself and most of the problems were with my .zshrc file. I managed to isolate the issue by running each command from the Laptop script individually until I saw an error that I could work on fixing. It’s a tough question, since it depends on so many different things. Hope someone from TB can chime in to help you get this fixed.