0

I just felt like learning haml so first installed ruby using my terminal this is my ruby version installed : ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

When i run this command : gem install haml i get this error :

MacBook-Pro:~ user$ gem install haml
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

Can anyone tell me where am i going wrong??

undefinedtoken
  • 921
  • 1
  • 8
  • 26
  • 1
    I guess you're trying to install a gem on a system ruby (no rvm/rbenv?) I've never really used system ruby in 3 years, but I think you have to `sudo gem install` in order to do that. Installing a Ruby manager such as RVM or RBenv is worth it if you want to do more than just have fun. Otherwise, have fun exploring! – Jonathan Allard Aug 19 '14 at 19:05
  • Hey @JonathanAllard it worked thanks alot for your quick response .. – undefinedtoken Aug 19 '14 at 19:08
  • No problem. See [*Gem install permission problem*](http://stackoverflow.com/questions/2619695/gem-install-permission-problem) for more info. (marked as duplicate) – Jonathan Allard Aug 19 '14 at 19:11
  • I don't think you should be modifying the system ruby because if you screw it up, you'll screw up your system. Install a more recent ruby version for yourself to play around with it. Check out rvm or rbenv to do that. After that never do `sudo gem install ...`, just do `gem install ...` – 7stud Aug 19 '14 at 19:22

0 Answers0