How to completely remove Ruby, Ruby gems on Mac OS X 10.6.4

13

1

Most rubyists might be shocked when they'll read this, but I'd like to know if it's possible to completely remove the Ruby framework as well as all the tools and gems that ship with Mac OS X 10.6.4.

Any help would be appreciated. (And explanations too if you think I'd rather not do this)

Thanks

just_a_dude

Posted 2010-09-29T14:23:29.950

Reputation: 445

2Just out of curiosity - why remove it? It's not exactly intrusive. Are you extremely short on disk space or something? – Matt – 2010-09-29T14:34:22.660

1I'm in agreement with other posters. Unless you've extremely short on disk space, I'd leave it go. It's possible there may be some underlying dependency that could be broken if you remove Ruby. – 8BitsOfGeek – 2010-09-29T15:48:03.127

1If you mess with files in the /System/ directory, you deserve whatever evils befall you. Just don't do it. – ghoppe – 2010-09-30T17:59:04.837

1It's easy to see what will be affected by removing the system Ruby. From the command-line type: find /usr -type f -name \*.rb. That will be one thing that is affected. Applications could expect ruby in /usr/bin also, and they will fail. In general, it's not a good idea to mess with executables in /usr/bin, /sbin or /usr/sbin. – TTM – 2011-11-22T23:32:36.987

@Greg You do realize that ruby files don't need a .rb extension? – Daniel Beck – 2011-12-05T18:53:52.033

Of course, but for this purpose it was sufficient. Beats trying to find all files with that extension, or that contain matches for all the tokens available in Ruby. – TTM – 2011-12-05T19:38:21.107

Answers

11

Just delete /System/Library/Frameworks/Ruby.framework, /Library/Ruby, and erb, gem, irb, rdoc, ri, ruby, and testrb from /usr/bin.

Warning: OS X expects and sometimes relies on frameworks and software shipped with the system. It would be a very bad idea to remove the system Ruby. It might even get replaced next time you update OS X -- or it might not, but OS X might expect it to be there, and then bad things will happen. Remove it at your own risk. I am providing this answer because you asked, but I would not recommend removing a system framework.

Why do you want to remove it? It's not hurting anything to sit there, unused.

mipadi

Posted 2010-09-29T14:23:29.950

Reputation: 3 980

Thanks guys, will not remove Ruby or Python :) – just_a_dude – 2010-10-01T12:53:38.033

I just removed it -- bundle from rvm would use site Ruby for some reason and this fixed it. – Vojto – 2011-05-02T05:28:51.660