Error: undefined method `resolve_alias' for Formula:Class

问题描述

  • 操作环境:mac

  • 动作:通过brew services命令启动grafana

brew services start grafana

报错信息:

Error: undefined method `resolve_alias' for Formula:Class
/usr/local/bin/brew-services.rb:154:in `service'
/usr/local/bin/brew-services.rb:203:in `check'
/usr/local/bin/brew-services.rb:193:in `run!'
/usr/local/bin/brew-services.rb:397:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:82:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:108:in `<main>'

解决过程

  • 根据关键报错信息google,得到的解决办法是执行命令brew update,没有work。
  • 考虑安装brew-services过程中执行了以下命令,怀疑是brew-services.rb版本旧,无奈https://gist.githubusercontent.com/打不开,无法验证猜测。
curl -o /usr/local/bin/brew-services.rb https://gist.githubusercontent.com/lwe/766293/raw/75a7907004bbff0eb3b072d1d951be2cfe7e5020/brew-services.rb

  • 更新HomeBrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

至此,问题解决,启动grafana成功。

grafana started stephen /Users/stephen/Library/LaunchAgents/homebrew.mxcl.grafana.plist

原文地址:https://www.cnblogs.com/webDepOfQWS/p/12766614.html