0

The other day I just randomly delete the whole ruby framework now I want to reinstall it. It is strange that I can not find /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby file even if I reinstall it. However, the lib under /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr appear each time I reinstall.

I use the command line dmg to reinstall, also I used the reinstalling xcode approach. But it is no use.

The homebrew is using the framework ruby. So that's why I want to reinstall the framework.

Can any people help me.

seanxiaoxiao
  • 1,282
  • 2
  • 11
  • 23
  • See http://stackoverflow.com/questions/4601003/how-to-downgrade-from-ruby-1-9-2-to-ruby-1-8-7-to-run-rails-2-0-2/4601098#4601098. Also, that is an old post, so you should instead install version 1.9.2 or 1.9.3. – Zabba Oct 10 '12 at 02:51

3 Answers3

2

Is there any reason to use Ruby 1.8? OSX comes with Ruby pre-installed but I like to use RVM to have more control over Ruby versions. If you want to, you could take a look at: https://rvm.io/rvm/install/

Also you need to remember that in order to install some gems you'll need a compiler and other development tools. In Mac OSX install disk you can optionally install the development tools that include XCode and command line tools. It's available on Apple's App Store.

Glauco Vinicius
  • 2,527
  • 3
  • 24
  • 37
  • The OS uses the Ruby that was bundled with it, so that functionality will no longer work. The OP is trying to reinstall that version, and RVM won't replace it, nor can it replace the functionality lost. – the Tin Man Oct 10 '12 at 03:28
0

Mac OS comes with Ruby installed for its own purposes, so it's important to leave that alone.

From a quick search, there's only one application that uses the built-in Ruby:

/usr/lib/podcastproducer

There might be other things, but that's all that popped up in a quick search using locate.

So, if you don't need to generate podcasts, you might be safe to not worry about reinstalling the system Ruby.

I'll recommend using either rbenv or RVM to manage your Ruby installation in a separate sandbox. That way, if you blow it away, deliberately or accidentally, you won't affect anything else.

If you go with either, read through their installation instructions a couple times before you install. StackOverflow is littered with questions from people who didn't bother to understand what they were doing before starting.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
  • I know that rvm is very good to help. But the homebrew is related to the ruby framework, so that's why I try to reinstall it. – seanxiaoxiao Oct 10 '12 at 05:14
  • 1
    Homebrew isn't related to Ruby. It's related to installing Linux packages on MacOS. Ruby is one of many such packages. Homebrew can install Ruby, just as it could install Python, MySQL or PostgreSQL. Personally, I recommend RVM or RBEnv because they support and manage multiple instances of Ruby, but that's your decision. – the Tin Man Oct 10 '12 at 05:27
0

You can change the interpreter in the first line of brew, Set it to the ruby in the RVM and it will work.

Furqan Safdar
  • 16,260
  • 13
  • 59
  • 93
Hui Tu
  • 24
  • 4