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)

link|improve this question
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. – David Dec 1 '11 at 1:24
feedback

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

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

3 Answers

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.

link|improve this answer
feedback

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
link|improve this answer
feedback

compile from source:

http://www.ruby-lang.org/en/downloads/

edit: uh, why the downvote?

link|improve this answer
no idea... But I don't think building from source would work since it installs it in usr/local/bin and not usr/bin – Alain Sep 17 '11 at 23:45
Typically, you can specify where you want to install something when building from source, e.g., ./configure --prefix=/usr. On the other hand, building from source probably won't make the package management system aware of the installation, which could cause problems. (I'm not intimately familiar with MacOS, so I don't know the details.) – Keith Thompson Dec 1 '11 at 4:15
feedback

Your Answer

 
or
required, but never shown