3

I upgraded my Mac to the new OSX 10.10.

brew update failed with:

/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 to follow "Getting a "bad interpreter" error when using brew", but I couldn't get it working.

I do not have Ruby in /usr/local/bin or /user/bin, which may be for same reason which ruby returns nothing.

I have Xcode 5.1 with the command line tools installed. Whenever I start 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?

Community
  • 1
  • 1
turbo
  • 589
  • 3
  • 20
  • Edit your bash file manually. Show all hidden files then navigate to your bash file and edit it. Also try upgrade to xcode 6.1 – Sylar Oct 23 '14 at 17:20
  • What did you upgrade *from* that you still had Ruby 1.8? Mavericks shipped with 2.0.0.. – Mark Reed Oct 23 '14 at 17:28
  • from Mavericks only but somehow brew.sh points to 1.8 version on first line – turbo Oct 23 '14 at 17:47

2 Answers2

1

First off upgrade Xcode to 6.1 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 My "Oh My Zsh" tools and restarting Xcode it installed some command line tools that I'm pretty sure are important.

Noximus
  • 11
  • 2
1

There are things to note:

  • Mac OSX does come with a Ruby preinstalled in /bin/ruby. That is Apple's own installation, used for some of their tools, and basically should be ignored. Updating it could break those tools, and worse, deleting it, will break them. Trying to reinstall it is a pain, so it's better to pretend it isn't there.
  • We generally recommend using either RVM or rbenv to manage/install any other Ruby version. Those tools are well tested and make it easy to switch back and forth between versions.
    • rbenv is easier to manage but lacks some of the features of RVM.
    • Closely follow the RVM installation instructions if you go that way; We see a lot of questions on Stack Overflow caused by people who ignore the directions, or who follow directions on a different site besides RVM's home site. (The RVM authors really do know better than anyone else how to make it work.)
  • Brew can install Ruby, but switching between versions gets stickier.
  • It sounds like your PATH variable doesn't include /usr/bin, which is odd, because it should. If it did, it should find the default Ruby.

    echo $PATH
    

    will display your search path. It's editable and, if

    ls /usr/bin/ruby
    

    shows that Ruby does exist in /usr/bin then you should add it back into the path. You can do that by editing ~/.bashrc, but also check ~/.bash_profile to make sure something isn't messing up the path. And, if you don't understand how the path works, take the time to read about it, because a badly set-up PATH variable can slow your use of the command-line, or cause all sorts of weirdness.

  • By default there is no /usr/local/bin/ruby. It won't exist using RVM or rbenv either, but Homebrew will probably put a symlink; I don't have it supplying my Ruby, so I can't check that.
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
  • tried with sudo \curl -sSL https://get.rvm.io | bash -s stable --ruby Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz rm: /Users/joshua/.rvm/src/rvm/bin/ruby-rvm-env: Permission denied – turbo Oct 23 '14 at 18:02
  • Why did you do `sudo`? – the Tin Man Oct 23 '14 at 18:05