0

I have been playing around with Jekyll and Ruby on my mac. I insalled Ruby 2.4 via MacPorts, messed something up and accidently deleted /Library/Ruby. I am now worried that I have messed up internals on my system.

How can I reinstall default Ruby Gems for Ruby 2.0 that comes with MacOS Sierra?

Jack H
  • 2,440
  • 4
  • 40
  • 63
  • There may be a less destructive way to do it. But you could always reinstall OS X over your current installation. This will replace all the system files but should keep your documents and stuff in check. However you may lose other elements of your configuration. – Ben Kelly Aug 18 '17 at 20:28
  • 2
    or maybe install rvm and use one of it's ruby as default. You can get away from using system ruby and settings most of the time. Using rvm/rbenv gives flexible advantage that if things go south, you can always nuke and reinstall. – kiddorails Aug 18 '17 at 20:31
  • Is there a specific reason to use such an old version of Ruby? Ruby `2.0` reached end-of-life more than one and a half year ago and is unsupported. I suggest using a Ruby version manager like `rbenv` and [installing an up-to-date version of Ruby](https://stackoverflow.com/a/36485498/2483313). – spickermann Aug 19 '17 at 10:54
  • 1
    Hi, purely because that's the version that ships with Mac OS Sierra. – Jack H Aug 19 '17 at 13:21

1 Answers1

0

1) Install rbenv

brew install rbenv

2) Install ruby version

rbenv install 2.0.0

3) Set your global env to 2.0.0

rbenv global 2.0.0

3 bis) Or set your local env to 2.0.0

rbenv local 2.0.0
Ronan Louarn
  • 472
  • 1
  • 6
  • 27