Created
December 1, 2011 17:26
-
-
Save jeffmccune/1418384 to your computer and use it in GitHub Desktop.
Repair Mac OS X Ruby Symlinks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# This script repairs Mac OS X site_ruby and ruby symbolic links if they are broken. | |
# For more information on this problem please see: http://openradar.appspot.com/9202152 | |
# | |
set -e | |
set -u | |
timestamp=$(date +%s) | |
if [[ -d /usr/lib/ruby ]]; then | |
/usr/bin/rsync -avxHEP /usr/lib/ruby/ \ | |
/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby/ | |
mv /usr/lib/ruby /usr/lib/ruby.backup.$timestamp | |
ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby /usr/lib/ruby | |
fi | |
if [[ -d /usr/lib/ruby/site_ruby ]]; then | |
/usr/bin/rsync -avxHEP /usr/lib/ruby/site_ruby/ \ | |
/Library/Ruby/Site/ | |
mv /usr/lib/ruby/site_ruby /usr/lib/ruby/site_ruby.backup.$timestamp | |
ln -s ../../../../../../../../../../Library/Ruby/Site /usr/lib/ruby/site_ruby | |
fi | |
# EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment