Brew update failed on Yosemite

I have updated my Mac to the new OSX 10.10.

brew update

failed:

/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

      

I tried " " Bad interpreter error "when using brew " but I couldn't get it to work.

I don't have Ruby in / usr / local / bin or / user / bin, which may be which ruby

returning nothing for the same reason .

I have Xcode 5.1 with command line tools installed. Whenever I start the terminal, I get:

-bash: /etc/profile.d/sm.sh: No such file or directory
-bash: /etc/profile.d/rvm.sh: No such file or directory

      

Can anyone suggest possible solutions?

+3


source to share


2 answers


Please upgrade Xcode to 6.1 first. This is the version that works with Yosemite.

After that, make sure you RUN Xcode and agree to the license (I know it sucks).



Note. After updating the "Oh My Zsh" tools and restarting Xcode, it installed some command line tools that I'm sure are important.

+1


source


It should be noted:



  • Mac OSX comes with Ruby preinstalled in / bin / ruby. This is Apple's own setup used for some of their tools and should mostly be ignored. Updating it can break these tools, and worse, removing it will break them. Trying to reinstall this pain, so it's best to pretend it's not there.
  • We generally recommend using RVM or rbenv to manage / install any other version of Ruby. These tools are well tested and make it easy to switch between versions.
    • rbenv is easier to manage but lacks some RVM functionality.
    • Carefully follow the instructions for installing RVM if you go this route; We see a lot of stack overflow questions caused by people who ignore directions, or who follow directions on a site other than the original RVM site. (The authors of RVM really know better than anyone else how to make it work.)
  • Brew can install Ruby, but switching between versions becomes more stylish.
  • It looks like your PATH variable doesn't include / usr / bin, which is odd because it should. If so, it should find Ruby by default.

    echo $PATH
    
          

    will display your search path. It is edited and if

    ls /usr/bin/ruby
    
          

    shows Ruby exists in / usr / bin, then you have to add it back to the path. You can do this by editing ~ / .bashrc, but also check your ~ / .bash_profile file to make sure something hasn't messed up the path. And, if you don't understand how the path works, take a moment to read about it, because a poorly configured PATH variable can slow down command line usage or cause all sorts of oddities.

  • There is no / usr / local / bin / ruby ​​by default. It won't exist using RVM or rbenv, but Homebrew will probably host a symlink; I don't have my Ruby delivery, so I can't test it.
+1


source







All Articles