brew uninstall -> Error: mpfr@2: undefined method `undent'

Created on 17 Jul 2018  路  20Comments  路  Source: Homebrew/brew

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • [ ] are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • [x] ran a brew command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [ ] ran brew doctor, fixed all issues and can still reproduce the problem?
    (I've tried linking and unlinking mpfr@2 and mpfr but I till get the error)
  • [x] ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)
    I'm trying to remove a package
  • What happened (include command output)
    brew uninstall, reinstall and doctor exit with
    Error: mpfr@2: undefined method `undent' for #<String:0x0000000101161258>
  • What you expected to happen
    The commands to succeed
  • Step-by-step reproduction instructions (by running brew commands)
$ brew remove mpfr@2
Error: mpfr@2: undefined method `undent' for #<String:0x00000001025cc3f0>
$ brew config
HOMEBREW_VERSION: 1.7.0-13-g63c5bd9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 63c5bd96a071074edc9c0e753e871faf1e8c8d1d
Last commit: 10 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 6fb6e40e54fb48e14a4b98b32f805a2d3a4fd298
Core tap last commit: 74 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_VISUAL: ne
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.3.7 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby
Clang: 9.1 build 902
Git: 2.18.0 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_162
macOS: 10.13.6-x86_64
CLT: 9.4.1.0.1.1528165917
Xcode: 9.4.1
XQuartz: 2.7.11 => /opt/X11

$ brew doctor
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  mpfr@2
Error: mpfr@2: undefined method `undent' for #<String:0x0000000101dba338>

Most helpful comment

I did a search of Homebrew, Caskroom, and Cellar and found multiple occurrences of <<-EOS.undent. Doing a global search for .undent and removing it fixed the error for me.

All 20 comments

Please run brew remove mpfr@2 --debug, thanks!

Hi, thanks for the quick response.


brew remove mpfr@2 --debug output (click on me)

**removed**

We鈥檙e also getting reports of this issue on the cask taps.

@vitorgalvao Of a failure to remove formulae?

Of undent not existing.

I did a search of Homebrew, Caskroom, and Cellar and found multiple occurrences of <<-EOS.undent. Doing a global search for .undent and removing it fixed the error for me.

clicked through to the merged PR (#4502) and saw a statement that the method was deprecated. The cask that's failing for me is kind of old - is deleting the directory (/usr/local/Caskroom/android-sdk for me) the recommended way for people to deal with this error now?

The error with Casks needs to have a separate issue. Feel free to open one @toejough or @onaforeignshore; no manual deletion should be required.

wow, solid 馃憤 on the fast response. Unfortunately, I'm churning through a bunch of installation updates right now and didn't expect to hear back from anyone for a while, so I already nuked the directory - I can make an issue, but I won't be able to provide the standard debug data the issue template asks for.

wait! I've got other old casks I just hadn't run into. I'll file new issue :-)

oh, well hold on - https://github.com/Homebrew/homebrew-cask/issues/49716#issuecomment-405599446 was a Casks issue, and was closed citing this one. Should that one be re-opened?

@publicarray @toejough what's the deal with this issue? I just upgraded Homebrew and it doesn't work anymore.

@yegor256 Please be more specific or just subscribe to the issue, please.

I'm seeing same issue after a brew update:

`[rwkelley@vector tools]$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/ec545d45d4512ace3570782283df4ecda6bb0044/Formula/python3.rb

################################################################## 100.0%

Error: python3: undefined method undent' for #<String:0x0000000102127890>

@kelleyrw That's because you're trying to install an old, unsupported Git revision of Python 3. We will not and cannot fix that.

@MikeMcQuaid The error message doesn't look like an a python issue per se. It looks like a ruby issue and the same error is seen above by @reitermarkus.

I Understand that this is not an appropriate comment here on this thread but just an observation: Why no support older versions of python? I'm not seeing a [email protected] for example. Doesn't it seem a bit risky to only support the latest version? Most production systems may be several version behind.

@MikeMcQuaid The error message doesn't look like an a python issue per se. It looks like a ruby issue and the same error is seen above by @reitermarkus.

@kelleyrw It is an issue with the fact you are trying to install a random revision of a formula from the Git history. This is not something we can fix or will fix. It's the same error because it's the same underlying cause: the method used in that formula was deprecated, disabled and now removed.

I Understand that this is not an appropriate comment here on this thread but just an observation: Why no support older versions of python? I'm not seeing a [email protected] for example. Doesn't it seem a bit risky to only support the latest version? Most production systems may be several version behind.

Please read https://docs.brew.sh/Versions.

Thank you for pointing this out.

For me, it's caused by mactex-no-ghostscript in .metadata.
Here's how to handle this issue in detail.

cd /usr/local/Caskroom     # or Cellar Homebrew
grep "<<-EOS.undent" -R .  # search the `undent` method
vim PATH_FROM_ABOVE        # locate the method and comment relative lines

@onaforeignshore thx.

Was this page helpful?
0 / 5 - 0 ratings