New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew unlink ruby removes large number of symlinks, link won't restore them #36058

Closed
cefn opened this Issue Jan 16, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@cefn
Copy link

cefn commented Jan 16, 2019

Background: I was notified by a bundle command that my version of bundle was old, and I should upgrade using gem install bundler.

Checked if bundler was currently provided by Brew and it was. I unlinked Brew's ruby to investigate using system's gem install bundler. I anticipated relinking if I hit any issue using 'system' ruby and gems to get the latest bundler.

$ brew unlink ruby
Unlinking /usr/local/Cellar/ruby/2.5.1... 3285 symlinks removed

Note it removed a large number of symlinks! However, brew link ruby then refused to restore any links...

$ brew link ruby
Warning: Refusing to link macOS-provided software: ruby

Tried upgrading ruby which was successful...

$ brew upgrade ruby
==> Upgrading 1 outdated package:
ruby 2.5.1 -> 2.6.0_1
[...]
==> Summary
🍺  /usr/local/Cellar/ruby/2.6.0_1: 19,334 files, 32.3MB

But still wouldn't link...

 brew link ruby
Warning: Refusing to link macOS-provided software: ruby

Requested logs

Have run brew update twice and brew doctor before reporting. Below are the requested logs...

$ brew gist-logs ruby
Error: No logs.
  • [ X] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
$ brew config
HOMEBREW_VERSION: 1.9.2-9-g9141b15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 9141b1509bb44da6c0a9683733ffe4a890690d8e
Last commit: 45 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d23cbd75ffd76d698eb3b97d8dcc9e2e872c522f
Core tap last commit: 55 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_LOGS: /Users/hoilec01/Library/Logs/Homebrew
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 10.0 build 1000
Git: 2.18.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 10.0.2
macOS: 10.13.6-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: 10.1
XQuartz: 2.7.11 => /opt/X11
$ brew doctor
Your system is ready to brew.
@SMillerDev

This comment has been minimized.

Copy link
Contributor

SMillerDev commented Jan 16, 2019

This is a feature introduced in: https://brew.sh/2019/01/09/homebrew-1.9.0/
You could use something like https://github.com/rbenv/rbenv to prioritize homebrew in your path.

@cefn

This comment has been minimized.

Copy link
Author

cefn commented Jan 16, 2019

That's very helpful, thankyou.

Is the mapping of the 3285 intended links still maintained anywhere in the short term, even if links can't be made or forced since Homebrew 1.9.0, so I can fathom what paths I've lost and what work is needed to reconstruct the same environment through rbenv?

@MikeMcQuaid

This comment has been minimized.

Copy link
Member

MikeMcQuaid commented Jan 21, 2019

Is the mapping of the 3285 intended links still maintained anywhere in the short term, even if links can't be made or forced since Homebrew 1.9.0, so I can fathom what paths I've lost and what work is needed to reconstruct the same environment through rbenv?

No, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment