Homebrew找不到任何软件包。

13

我的Mac Pro硬盘损坏后,我刚从店里拿回来。现在我正在尝试重新安装我的开发环境。

我从Homebrew网站上的当前链接安装了Homebrew:

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

但我无法安装任何软件包。Brew什么都找不到。

 ~ brew install rbenv
Error: No available formula with the name "rbenv"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

有什么问题吗?

2个回答

39

我曾经遇到同样的问题,通过运行doctor命令并按照需要更新的步骤解决了它。

我的homebrew-core不在主分支上。

brew doctor 
git -C $(brew --repo homebrew/core) checkout master

就是这样。在那之后,我能够运行rbenv install命令。


已经在'master'分支上 你的分支与'origin/master'同步。 - Viraj Singh
@VirajSingh 只需重试安装软件包。我也收到了同样的消息,但我的问题已经解决了。 - Pavindu

0

brew 搜索结果

$ brew search rbenv
==> Formulae
rbenv                        rbenv-bundle-exec            rbenv-chefdk                 rbenv-default-gems           rbenv-vars
rbenv-aliases                rbenv-bundler                rbenv-communal-gems          rbenv-gemset                 rbenv-whatis
rbenv-binstubs               rbenv-bundler-ruby-version   rbenv-ctags                  rbenv-use

安装 rbenv

$ brew install rbenv
==> Downloading https://github.com/rbenv/ruby-build/archive/v20200819.tar.gz
==> Downloading from https://codeload.github.com/rbenv/ruby-build/tar.gz/v20200819
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/rbenv-1.1.2.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Installing dependencies for rbenv: ruby-build
==> Installing rbenv dependency: ruby-build
==> ./install.sh
==> Caveats
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.

To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/rchen/.bash_profile:
  export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"

Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.
==> Summary
  /usr/local/Cellar/ruby-build/20200819: 509 files, 253.6KB, built in 5 seconds
==> Installing rbenv
==> Pouring rbenv-1.1.2.mojave.bottle.tar.gz
  /usr/local/Cellar/rbenv/1.1.2: 36 files, 65KB
==> Caveats
==> ruby-build
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.

To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/rchen/.bash_profile:
  export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"

Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.

版本测试

$ rbenv --version
rbenv 1.1.2

是的,我曾经尝试过这个(抱歉,由于某些原因无法将其格式化为代码) ~ brew search rbenv 没有找到“rbenv”的配方或瓶子。 关闭的拉取请求: ...(太长了) - 7fc9ecfc6810c58545e1bc3b556003
顺便说一下,我成功地通过使用rbenv存储库而不是brew来安装了rbenv和ruby,但是brew仍然无法工作。 - 7fc9ecfc6810c58545e1bc3b556003

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接