Homebrew 安装 Elasticsearch 失败。

huangapple go评论85阅读模式
英文:

brew installation of elasticsearch failing

问题

尝试使用brew安装ElasticSearch,但是所有尝试都失败了,出现错误:

错误:子进程内部发生异常:
NoMethodError:未定义方法`path' for nil:NilClass
你是不是想说?paths

有人遇到过类似的情况吗?

brew安装的--debug输出如下:

➜  ~ brew install --debug elasticsearch
更新Homebrew...
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader):加载 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/elasticsearch.rb
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -version
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -version
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader):加载 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/elasticsearch.rb
错误:子进程内部发生异常:
NoMethodError:未定义方法`path' for nil:NilClass
你是不是想说?paths
/usr/local/Homebrew/Library/Homebrew/extend/os/mac/extend/ENV/super.rb:112:在`setup_build_environment'中
/usr/local/Homebrew/Library/Homebrew/build.rb:88:在`install'中
/usr/local/Homebrew/Library/Homebrew/build.rb:196:在`<main>'中

谢谢!
英文:

Been trying to install ElasticSearch using brew, however, all my attempts fail and error

    Error: An exception occurred within a child process:
  NoMethodError: undefined method `path&#39; for nil:NilClass
Did you mean?  paths

is fired back at me. anyone ever crossed this?
brew install --debug output is:

➜  ~ brew install --debug elasticsearch
Updating Homebrew...
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/elasticsearch.rb
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -version
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -version
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/elasticsearch.rb
Error: An exception occurred within a child process:
  NoMethodError: undefined method `path&#39; for nil:NilClass
Did you mean?  paths
/usr/local/Homebrew/Library/Homebrew/extend/os/mac/extend/ENV/super.rb:112:in `setup_build_environment&#39;
/usr/local/Homebrew/Library/Homebrew/build.rb:88:in `install&#39;
/usr/local/Homebrew/Library/Homebrew/build.rb:196:in `&lt;main&gt;&#39;

thanks!

答案1

得分: 6

最终,问题是因为Xcode版本过旧。更新Xcode解决了这个问题。

英文:

Eventually it was due to the fact xcode was outdated. Updating xcode fixed the problem.

答案2

得分: 1

以下是翻译好的内容:

在 Elastic 网站上针对 使用 Homebrew 在 macOS 上安装 Elasticsearch 的说明建议使用不同的公式,即:

brew tap elastic/tap

然后

brew install elastic/tap/elasticsearch-full

或者

brew install elastic/tap/elasticsearch-oss

这取决于您是想要非免费(但仍为 $0.00)版本还是 OSS 版本。

我自己实际上还没有尝试过这个公式,但我刚刚在 macOS Catalina 上使用 brew install openjdk@11 成功获取了所需的 Java 版本,然后通过手动安装 logstash-7.6.2 的 tar 文件来安装,确保在运行 logstash 程序之前执行了 export JAVA_HOME=/usr/local/opt/openjdk@11;我认为相同的方法可能适用于 elasticsearch,尽管上面的官方公式可能更简单。

英文:

The instructions for Installing Elasticsearch on macOS with Homebrew on the elastic website suggest using a different formula, namely:

brew tap elastic/tap

then

brew install elastic/tap/elasticsearch-full

or

brew install elastic/tap/elasticsearch-oss

depending on whether you want the non-Free (but still $0.00) or OSS version.

I haven't actually tried that formula myself, but I have just had success on macOS Catalina with brew install openjdk@11 to get the required Java version, then I installed the tarfile of logstash-7.6.2 by hand, making sure to do export JAVA_HOME=/usr/local/opt/openjdk@11 before running the logstash program; I assume the same approach will work with elasticsearch, although the official formula above is probably simpler.

答案3

得分: 0

以下是一个临时解决方案,直到 Homebrew 被修复:

  1. 通过以下方式禁用 Homebrew 的自动更新:要么像这样在你的 brew 命令前加上前缀:HOMEBREW_NO_AUTO_UPDATE=1 brew install elasticsearch,要么在你的 Bash .profile 文件中设置一个环境变量,如 export HOMEBREW_NO_AUTO_UPDATE=1(我使用的是后者)。

  2. 如果你将 Homebrew 安装为一个位于 /usr/local/Homebrew 的 GIT 仓库,在那个目录下查看 GIT 日志。你应该会看到最近对 stable 分支进行了合并,引入了新的代码到 super.rb 文件:

    2ae2680 (tag: 2.2.12, stable) Merge pull request #7301 from Bo98/cmake-sdkroot

  3. 你想在 /usr/local/Homebrew git 仓库中检出一个之前的提交。这对我来说行之有效:

    <strike>/usr/local/Homebrew> git checkout stable^</strike><br/>
    <strike>HEAD is now at 6e3a293... Merge pull request #7300 from bayandin/patch-1</strike>

    > 更正!"stable" 分支最近移动到了 2.2.13。提交历史仍然包含有问题的提交:2ae2680 (tag: 2.2.12) Merge pull request #7301 from Bo98/cmake-sdkroot。取代标签之前的提交进行检出。

/usr/local/Homebrew&gt; git checkout -q 2.2.12^
/usr/local/Homebrew&gt; git branch -vv --no-color
* (HEAD detached at 6e3a293) 6e3a293 Merge pull request #7300 from bayandin/patch-1
   master c9ffde6 [origin/master] Merge pull request #7351 from Bo98/branch-encode
   stable 3d9cf83 Merge pull request #7346 from Bo98/pr-pull
  1. 当你准备撤销步骤 #3 中的更改时,运行 brew update 将会检出 stable 分支(处于无论何种状态)。
英文:

The following is a temporary work-around until Homebrew is fixed.

  1. Disable the Homebrew auto-update by either prefixing your brew commands like this: HOMEBREW_NO_AUTO_UPDATE=1 brew install elasticsearch or setting an environment variable in your Bash .profile as export HOMEBREW_NO_AUTO_UPDATE=1. (I am using the latter.)

  2. If you have Homebrew installed as a GIT repository under /usr/local/Homebrew, go to that directory to review the GIT log. You should see a recent merge to the stable branch introduced new code to super.rb:
    > 2ae2680 (tag: 2.2.12, stable) Merge pull request #7301 from Bo98/cmake-sdkroot

  3. You want to checkout a previous commit in your /usr/local/Homebrew git repo. This did the trick for me:

    <strike>/usr/local/Homebrew> git checkout stable^</strike><br/>
    <strike>HEAD is now at 6e3a293... Merge pull request #7300 from bayandin/patch-1</strike>

> CORRECTION! The "stable" branch moved recently to 2.2.13. The commit history still contains the problem commit: 2ae2680 (tag: 2.2.12) Merge pull request #7301 from Bo98/cmake-sdkroot.

Checkout the commit-before-the-tag instead.

/usr/local/Homebrew&gt; git checkout -q 2.2.12^
/usr/local/Homebrew&gt; git branch -vv --no-color
* (HEAD detached at 6e3a293) 6e3a293 Merge pull request #7300 from bayandin/patch-1
   master c9ffde6 [origin/master] Merge pull request #7351 from Bo98/branch-encode
   stable 3d9cf83 Merge pull request #7346 from Bo98/pr-pull
  1. When you are ready to undo the changes in step #3, running brew update will checkout the stable branch (at whatever state that will be).

huangapple
  • 本文由 发表于 2020年4月10日 04:10:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/61129432.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定