Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

OS X 10.10 ships with Ruby 2.0 as the default, no 1.8.7 #29795

Closed
wfarr opened this issue Jun 2, 2014 · 23 comments
Closed

OS X 10.10 ships with Ruby 2.0 as the default, no 1.8.7 #29795

wfarr opened this issue Jun 2, 2014 · 23 comments

Comments

@wfarr
Copy link
Contributor

wfarr commented Jun 2, 2014

With the release of Mavericks, while Ruby 1.8.7 was included to support some legacy software shipped by Apple, in the Command Line Tools package, Ruby 2.0.0 was made the default installed Ruby.

Ruby 1.8.7 is gone from Yosemite (as I mentioned was the intention back during the Mavericks DP releases, when i last brought this up). It's not installed. At all. And it almost certainly won't make a return.

There are several files managed by Homebrew which, rather than relying on symlinks created in the default path of /usr/bin, rely on this hardcoded 1.8.7 path:

$ git grep  /System/Library/Frameworks/Ruby.framework/Versions/1.8
Library/Contributions/cmd/brew-server:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Library/ENV/4.3/cc:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/ENV/4.3/cc:$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
Library/ENV/4.3/xcrun:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/ENV/4.3/xcrun:$:.unshift "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8"
Library/brew.rb:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0

Since relying on regular old /usr/bin/ruby will work fine under Mavericks — so long as Homebrew is 2.0.0-ready, which it must be before too long now anyway —I think it would be prudent to switch all these paths over.

I'm happy to do the PR work for this, but I want to make sure the change is going to be accepted first.

@delasteve
Copy link

This was not here when I was editing my PR. Anywho...

I just created the pull request for the last file you mention. I will update it so that it includes the other hardcoded paths.

See #29796

@wfarr
Copy link
Contributor Author

wfarr commented Jun 2, 2014

Thanks @delasteve

@jacknagel
Copy link
Contributor

We're aware of this, of course. The most helpful thing that people can do at this point is just have a little patience while myself and the other maintainers decide what to do. Thanks.

@wfarr
Copy link
Contributor Author

wfarr commented Jun 3, 2014

/cc #20564, from last June

@JoshTGreenwood
Copy link

Is there any immediate fix for this? After switching to Yosemite this afternoon, my brew was broken:

 ->  brew
/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

@mistydemeo
Copy link
Member

The most helpful thing that people can do at this point is just have a little patience while myself and the other maintainers decide what to do. Thanks.

@jacknagel
Copy link
Contributor

So Apple dropped this little gift in /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:

  CONFIG["includedir"] = (ENV['SDKROOT'] || (File.exists?(File.join(CONFIG['prefix'],'include')) ? '' : %x(xcode-select --print-path >/dev/null 2>&1 && xcrun --sdk macosx --show-sdk-path 2>/dev/null).chomp)) + "$(prefix)/include"

This causes a fork bomb under superenv on Xcode-only systems, because (1) this invokes the first xcrun in PATH, (2) our wrapper is first in PATH, (3) our wrapper is written in Ruby, (4) ruby > 1.8 loads rubygems by default, (5) rubygems loads rbconfig.

I need to rewrite the xcrun wrapper in shell or otherwise work around this issue before we can flip the switch on this. In the meantime here is a patch that would do it: https://github.com/jacknagel/homebrew/compare/rb2

(Note that we strongly advise against upgrading to the 10.10 preview at this time unless you are developing for that platform.)

@adamv adamv changed the title Switch hardcoded ruby paths to use /usr/bin/* OS X 10.10 ships with Ruby 2.0 as the default, no 1.8.7 Jun 3, 2014
@adamv
Copy link
Contributor

adamv commented Jun 3, 2014

(Edited bug title)

@lukeman
Copy link

lukeman commented Jun 3, 2014

Thanks @jacknagel. I'm back in business after applying and installing the command line tools from the ADC: http://adcdownload.apple.com/Developer_Tools/command_line_tools_os_x_10.10_for_xcode__june_2014/command_line_tools_for_osx_10_10_june_2014.dmg

@daenney
Copy link
Contributor

daenney commented Jun 3, 2014

This is related: #29809.

@daenney
Copy link
Contributor

daenney commented Jun 3, 2014

@jacknagel Thank you for your quick fixes in the rb2 branch. I just applied them to my system and it's happily brewing again.

@notjosh
Copy link

notjosh commented Jun 3, 2014

@lukeman Installing the command line tools did the trick for me. Thanks!

@cortices
Copy link

cortices commented Jun 3, 2014

I solved temporarily by copying the ruby 1.8 Version inside Ruby.framework from a Mavericks backup. But this only returned it to functional state; doesn't fix the problem. I also experienced the fork bomb problem when trying to coerce it to run under Ruby 2.0.

@pincheira
Copy link

@jacknagel thanks a lot! Your fork/branch makes it work on 10.10.

Here's a little gist with the modified launcher/installation script that points to that branch to install it on 10.10 easily. https://gist.github.com/jpincheira/bd3698fee46735fac252

@ryan-mars
Copy link

Wow that was fast.

@daenney
Copy link
Contributor

daenney commented Jun 3, 2014

@jacknagel Doesn't your commit still need the xcrun changes form your fork to work on Yosemite?

@tcarlsen
Copy link

tcarlsen commented Jun 4, 2014

👍 works like a charm!

@bhushangahire
Copy link

Anyone able to install ruby 1.9.2-p290 with this. I am able to install ruby 2.1 with RVM. Needs help.

@mistydemeo
Copy link
Member

@bhushangahire That issue is not related to this; please file a new issue with details on your problem.

If you're having problems with RVM, though, you'll have to speak to the RVM develoeprs.

@bhushangahire
Copy link

Sure thanks I thought if anyone able to solve it. This is the only active thread I found on 10.10

@WebRuin
Copy link

WebRuin commented Aug 6, 2014

@MikeMcQuaid
Copy link
Member

@radius314 Please don't provide instructions for users to mess around with system files like that. It will likely break Homebrew and other software in future. Thanks!

@MikeMcQuaid
Copy link
Member

@j-mcnally Please don't instruct people on our issue tracker to do things that will cause them to file more issues on our issue tracker.

@Homebrew Homebrew locked and limited conversation to collaborators Aug 7, 2014
jessestuart added a commit to jessestuart/groovy.tmbundle that referenced this issue Aug 19, 2014
Bundle does not work out of the box with OS X 10.10, because Yosemite
ships w/ 2.0 as the default (see ticket
[here](Homebrew/legacy-homebrew#29795)). Switching
this to use the ‘Current’ alias will circumvent this problem.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests