brew upgrade <package> 没有更新到最新版本

brew upgrade <package> does not update to the latest version

我注意到这种情况发生过几次,但最近的一次是 wp-cli 运行 brew upgrade wp-cli 没有下载最新版本。

$ brew upgrade wp-cli
Error: homebrew/php/wp-cli 0.20.1 already installed

$ brew info wp-cli
homebrew/php/wp-cli: stable 0.20.1, HEAD
A set of command-line tools for managing WordPress installations.
http://wp-cli.org/
/usr/local/Cellar/wp-cli/0.20.1 (2635 files, 15M) *
  Built from source
From: https://github.com/Homebrew/homebrew-php/blob/master/Formula/wp-cli.rb

注意版本是 0.20.1。当我检查 the formula repo 时,我看到

head "https://github.com/wp-cli/wp-cli.git"

当我检查that repo, I see that the version in the master branch is 0.24.0brew infowp --version 都 return 0.20.1。为什么 Homebrew 不抓取最新版本?我如何强制它获取最新的?

您需要先 运行 brew update 强制 brew 更新其公式列表。