Take the 2-minute tour ×

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)

share|improve this question

migrated from stackoverflow.com Dec 1 '11 at 0:54

This question came from our site for professional and enthusiast programmers.

Try reinstalling Xcode and developer's tools. –  Eimantas Sep 17 '11 at 4:45
Can't you restore this file from a Time Machine backup? –  Raim Sep 17 '11 at 9:18
no time machine here (yes, I know...). Tried to reinstall Xcode but it did not add it back –  Alain Sep 17 '11 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. –  Phpdevpad Dec 1 '11 at 1:24

2 Answers 2

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.

share|improve this answer
That doesn't really work on OS X. –  slhck Jul 16 '12 at 12:30

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
share|improve this answer

Your Answer


