Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows x64 RabbitMQ install error with Erlang environment var (ERLANG_HOME)

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

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

After Erlang install using default install location to C:\Program Files\erl5.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. 

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?

like image 778
Kevin Won Avatar asked Sep 07 '12 18:09

Kevin Won


People also ask

How do I install RabbitMQ and Erlang on Windows?

Set ERLANG_HOME to where you actually put your Erlang installation, e.g. C:\Program Files\erl{version} (full path). The RabbitMQ batch files expect to execute %ERLANG_HOME%\bin\erl.exe. Go to Start > Settings > Control Panel > System > Advanced > Environment Variables.

Is Erlang required for RabbitMQ?

While not officially supported, Erlang and hence RabbitMQ can run on most systems with a POSIX layer including FreeBSD, Solaris, NetBSD, OpenBSD and many more.


2 Answers

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.

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!\bin\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!\bin\erl.exe"  

I simply hardcoded the path to my erl.exe:

"C:\Program Files\erl5.9.2\erts-5.9.2\bin\erl.exe"  

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

like image 186
Kevin Won Avatar answered Oct 25 '22 15:10

Kevin Won


1- Set environment variable:

Variable name : ERLANG_HOME
Variable value: C:\Program Files (x86)\erl6.4

note: don't include bin on above step.

2- Add %ERLANG_HOME%\bin to the PATH environmental variable:

Variable name : PATH
Variable value: %ERLANG_HOME%\bin

This works well.

like image 25
John Davis Avatar answered Oct 25 '22 15:10

John Davis