Gem File Permission Error; Environment Setup; Dotfiles

Hello, I am currently trying to setup my environment. When I enter: ~/.dotfiles/bin/install_requirements
I have success until I receive this error:

install_requirements: Installing bundler and gems…
install_requirements: Press enter to continue.

ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
/Users/coreyladovsky/.dotfiles/bin/install_requirements: line 101: bundle: command not found
install_requirements: Gems installed

After the error everything else seems to install normally. Not sure how to fix this error. Ive looked online but nothing has been clear to me. Thanks for your help in advance.

Hey! See if any of these work for you:

Hey, thanks for getting back to me. I haven’t had any luck yet but I suspect it has something to do with my computers OS system. I tried updating it but found there is a problem with the hard drive. I will switch it out with a new one later today or tomorrow and then try again. I’ll get back to you if I am still unsuccessful. Thanks.

Okay, so with the most recent OS and up to date Xcode I was able to install the bundle after following these steps:
Thanks :slight_smile:

Hey @MichaelMCoates, thanks for your help so far. I was able to install the bundle from following the stackoverflow link from above; but when I attempt to instal the dot files I am receiving the following:

Coreys-MacBook-Pro:~ coreyladovsky$ ~/.dotfiles/bin/install_dotfiles
rbenv: ruby: command not found

The `ruby’ command exists in these Ruby versions:

Do you or anybody else reading this know what I am doing wrong? Thanks for any and all help.

Hey! What is your ruby version? Try running:

rbenv versions

When I run rbenv versions I get this:
Coreys-MacBook-Pro:~ coreyladovsky$ rbenv versions

  • 2.3.1 (set by /Users/coreyladovsky/.rbenv/version)

Cool, you do have rbenv installed, and the latest version of ruby. What happens when you do:

ruby -v

I believe I do have rbenv installed. I just walked through the steps again on that Stackflow link. Now when I typed in ruby -v I get this: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin16]

But when I got to install the dotfiles I am now getting this:
Coreys-MacBook-Pro:~ coreyladovsky$ ~/.dotfiles/bin/install_dotfiles
(erb):21:in ``’: No such file or directory - npm (Errno::ENOENT)
from (erb):21:in text' from /Users/coreyladovsky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/erb.rb:863:ineval’
from /Users/coreyladovsky/.rbenv/versions/2.2.3/lib/ruby/2.2.0/erb.rb:863:in result' from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:43:intext’
from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:74:in compile_diff' from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:47:indiff’
from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:51:in changed?' from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:121:inselect’
from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:121:in main' from /Users/coreyladovsky/.dotfiles/bin/.install_dotfiles.rb:161:in