Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

1  
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. – Betterdev Dec 1 '11 at 1:24

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

You must log in to answer this question.

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