本文介绍了Windows x64 RabbitMQ 安装错误与 Erlang 环境变量 (ERLANG_HOME)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问/回答这个问题是因为它把我挂断了 &很可能其他人也会遇到同样的问题.

I'm ask/answering this question because it hung me up & it's likely someone else will have the same problem.

在 Windows Server 2008 x64 上安装 RabbitMQ x64 v2.8.6.

Install of RabbitMQ x64 v2.8.6 on Windows Server 2008 x64.

使用默认安装位置 C:Program Fileserl5.9.2 安装 Erlang 后,我试图通过运行 rabbitmq-service.bat 来启动服务器.失败:

After Erlang install using default install location to C:Program Fileserl5.9.2, I'm attempting to start the server via running the rabbitmq-service.bat. Fail:

Please either set ERLANG_HOME to point to your Erlang installation
or place the RabbitMQ server distribution in the Erlang lib folder.

问题是 .bat 文件没有正确的子路径.带有 5.9.2 (R15B02) 版本的 erlang.我的 ERLANG_HOME 目录设置正确,但脚本没有正确使用这个版本的 Erlang,在这个 Erlang 菜鸟看来,有一个名为erts-5.9.2"的新子目录导致了问题.也许熟悉这些脚本的人可以描述如何在没有我将要描述的 hack 解决方法的情况下使其正常工作?

Problem is the .bat file does not have the correct subpath. with 5.9.2 (R15B02) version of erlang. My ERLANG_HOME directory is set correctly, but the script does not use it correctly for this version of Erlang, which, it appears to this Erlang noob to have a new subdirectory called "erts-5.9.2" which is causing the problems. Maybe someone intimate with these scripts can describe how to make this work correctly without the hack workaround I'm about to describe?

推荐答案

windows上有几个RabbitMQ控制.bat文件.您使用的每一个都需要更改以正确反映 Erlang 路径.在此示例中,我正在编辑 rabbitmq-server.bat,因为它是更简单的文件之一...您要运行的任何 .bat 文件都需要使用 rabbitmq_service.bat 文件才能使它们工作是参与调整最多的人.

There are several RabbitMQ control .bat files on windows. Every one you use needs to get changed to reflect the Erlang path correctly. In this example, I'm editing the rabbitmq-server.bat because it's one of the easier ones... any of the .bat files you want to run will need this hack to get them to work, with the rabbitmq_service.bat file being the most involved to adjust.

编辑那个 rabbitmq_server.bat 文件,你可以看到大约在第 48 行左右,有一个检查是否找到了 erl.exe,但路径不正确:

editing that rabbitmq_server.bat file, you can see on about line 48 or so there's a check to see if the erl.exe is found, but the path isn't correct:

if not exist "!ERLANG_HOME!inerl.exe" (

该路径与 Erlang 5.9.2 版本的文件结构不匹配.我通过简单地从第 48 行到第 58 行删除此路径检查来解决此问题,然后,.bat 实际上在第 129 行调用 erl.exe,内容如下:

that path does not match the file structure for the 5.9.2 version of Erlang. I fixed this by simply removing this path check from about line 48 to 58, then, where the .bat actually makes a call to the erl.exe on about line 129 which reads:

"!ERLANG_HOME!inerl.exe"

我只是硬编码了我的 erl.exe 的路径:

I simply hardcoded the path to my erl.exe:

"C:Program Fileserl5.9.2erts-5.9.2inerl.exe"

路径正确后,rabbitmq .bat 文件将运行.

With the pathing correct, the rabbitmq .bat files will run.

这篇关于Windows x64 RabbitMQ 安装错误与 Erlang 环境变量 (ERLANG_HOME)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 14:18
查看更多