1

I'm trying to get Ruby on Rails running on my work computer, however there are admin privileges that are not allowing me to install it. When I try to install it I get You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. I was able to circumvent the admin issue to install Node.js, NPM, and Homebrew on my computer, but I'm having a hard time with Rails. Is there a way to install Rails and gems into a customized folder that I'm able to write to and access the commands in terminal? (or any other solution you can think of)

My ruby version is 2.0.0, don't believe I have permission to upgrade this (unless I can install it in a different directory).

You may be wondering why I have to go through this, my company hired me as a web developer but I'm not under the IT department so they are resistant to me installing random languages and frameworks.

Thank you!

tposs
  • 53
  • 5

2 Answers2

1

You can use RVM or rbenv. Those are tools that manage your ruby environment (interpreter version, gems) and let you keep all the gems in user directories.

In short: install rvm or rbenv, then install ruby using one of them and then - you can install your gems without admin rights. You'll get an ability to upgrade ruby to the newest version for free :).

It looks you're using mac, so see this guide.

mrzasa
  • 22,895
  • 11
  • 56
  • 94
  • I went through the steps, I was able to get `rbenv` installed, and I ran the command to install a version. When I run `rbenv global 2.4.0` though it does not update my global version. `ruby -v` remains `2.0.0`. Also, I tried again `gem install bundler` and it gave me the same error I mentioned above. I'm not a rails developer, and I'm out of ideas. Let me know if you have any more! – tposs Apr 04 '18 at 21:48
  • 1
    See [this answer](https://stackoverflow.com/a/12150580/580346), maybe it'll help you – mrzasa Apr 04 '18 at 22:02
  • I added the solution stated in the first answer to your link, and it worked! I think i came across that article, but didn't work last time I tried. Thank you so much for your help! – tposs Apr 04 '18 at 22:15
0

I would have someone from IT sit with you as you setup your box via this GoRails guide. Homebrew will detail the permissions and folders you need to chmod. This is why you need the IT person. Once you get the permissions set appropriately, you will be able to install any version of Ruby and Gems without sudo.

Honestly this is just a band-aid to a bigger issue.

dr.
  • 1,429
  • 12
  • 18
  • 1
    I'm in the process of going through the admin hoops to get IT to allow something like this to happen. My team, apparently, have been trying to get these permissions for over a year. Bureaucracy. :( – tposs Apr 04 '18 at 21:42