且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows x64 RabbitMQ 安装错误与 Erlang 环境变量 (ERLANG_HOME)

更新时间:2021-08-08 23:05:35

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.