0

I won't go into the details of why I did this because I already feel stupid enough but I deleted ruby from the use/bin folder and now Brew does not want to work.

How can I fix this?

(I am on Lion)

4
  • 1
    Try reinstalling Xcode and developer's tools.
    – Eimantas
    Sep 17, 2011 at 4:45
  • Can't you restore this file from a Time Machine backup?
    – raimue
    Sep 17, 2011 at 9:18
  • no time machine here (yes, I know...). Tried to reinstall Xcode but it did not add it back
    – Alain
    Sep 17, 2011 at 20:04
  • This isn't answer but you can replace the remove command with an alias to just move the file to a folder to store your files before you decide to permanently delete the files. It's like to have a trash desktop icon but on the command line. You can either replace rm or create a new command for example del. If you replace rm command and you want to delete a file just move the file to /dev/null.
    – Micromega
    Dec 1, 2011 at 1:24

2 Answers 2

0

Ruby isn't a critical system file (as far as I know), so I'd imagine you should be able to reinstall it. Just follow the same procedure you did to install Ruby in the first place. See e.g. official instructions.

1
  • That doesn't really work on OS X.
    – slhck
    Jul 16, 2012 at 12:30
0

On a standard system, /usr/bin/ruby is a symlink to ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby

If you still have that file, you can just link it back:

sudo ln -s '../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby' /usr/bin/ruby

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .