像一个白痴,我设法删除我的系统
ruby安装.
我已经重新安装了xcode,并且还安装了RVM
这样做:
$which ruby
返回此:
/Users/alex/.rvm/bin/ruby
然而,自制仍然似乎被打破了:
$brew -bash: /usr/local/bin/brew: /usr/bin/ruby: bad interpreter: No such file or directory
解决方法
在OS X上的系统ruby与Ruby.framework符号链接.由于您重新安装了Xcode,所以应该安装它,但是您需要恢复符号链接.
首先,检查该文件是否存在并可用.
$/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
如果该命令有效,您应该可以再次设置sym链接
cd /usr/bin sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby /usr/bin/ruby sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/erb /usr/bin/erb sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/gem /usr/bin/gem sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/irb /usr/bin/irb sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/rake /usr/bin/rake sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/rdoc /usr/bin/rdoc sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ri /usr/bin/ri sudo ln -s ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/testrb /usr/bin/testrb
这应该让你开始,希望我没有忘记任何需要链接的二进制文件.还有其他建议在这里重新安装ruby:https://superuser.com/questions/171433/is-it-possible-to-reinstall-fix-mac-os-xs-system-ruby-without-doing-a-complete