How to get Ruby / Homebrew / RVM to work on Yosemite?

前端 未结 11 1903
自闭症患者
自闭症患者 2020-11-30 19:32

After installing Yosemite, I was unable to run brew or ruby.

I was getting this error on brew update:

/usr/local/bin/brew: /usr/local/Library/brew.r         


        
11条回答
  •  猫巷女王i
    2020-11-30 19:58

    I updated to Yosemite and later found out brew was broken.

    /usr/local/bin/brew: /usr/local/Library/brew.rb: 
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0
    

    If you haven't made any changes to brew yet, here is what I recommend. Otherwise read further below.

    1. cd /System/Library/Frameworks/Ruby.framework/Versions/
    2. sudo ln -s Current 1.8
    3. brew update
    4. sudo unlink 1.8

    Already made changes to brew files and stuck in a git mess?

    I tried to edit /usr/local/Library/brew.rb but the local change to my git repo was preventing brew update from pulling down updates. I tried some other solutions mentioned on this page and from other sites and I ended up with a git mess and all I wanted to do was undo everything I had done to brew.

    I committed my change but it made things worse. Eventually I had to undo my commits and git reset --hard HEAD~1 until I was at the right commit-ish. I had a mess of unversioned files too (I changed files permissions in /usr/Local) so I did a git clean -f -d which removed all unversioned files and directories and got me back to where I started before I made any changes.

提交回复
热议问题