11

I recently installed Erlang RFC4627 (JSON-RPC) with the debian package. I ran the test server using:

sudo erl -pa ebin 

and then at the prompt:

test_jsonrpc:start_httpd(). 

returned

ok 

I tested with http://:5671/ and got the success messages.

When I try to run rabbitmq-http2 however, I get the errors that the readme says are caused by rfc4627's code not being on the erlang search path. How do I put it on the path. I saw something on Dave Thomas's blog which suggested putting the path in the file:

~/.erlang 

This didn't seem to work for me (maybe I did it wrong?).

3
  • Gordon, I appreciate your answer below (voted it up). Unfortunately I have tried several methods including the .erlang file and applying the path to the -pa in the make file. I guess my question is a little more particular to rfc4627 and rabbitmq-http2. Commented Aug 9, 2009 at 16:46
  • Add more information about paths to the directories with the beams, and how you add the paths to the code server. Especially, where do you have the beams for the rfc4627 library? Commented Aug 13, 2009 at 11:49
  • Christian, actually, I got this all working, I've been meaning to respond to this explaining some of what I did. I'll probably do that later this week. Commented Aug 18, 2009 at 1:20

1 Answer 1

20

The code module is how you manipulate the path within an application.

The flags -pa that you used in starting the Erlang shell actually refer to a function in this module:

add_patha(Dir) -> true | {error, What} 

You are right about the .erlang file in your home directory - it is run at start-up time of the shell and you can add in handy paths.

For an application you can start the shell with a batch file that calls something like this:

erl -pa ./ebin ../../lib/some/path/ebin 

The flags behaviour of erl is described here.

For more sophisticated path management you need to get familiar with how OTP release management is done (but I suspect that is a while away for you yet).

Sign up to request clarification or add additional context in comments.

3 Comments

as stated above, I didn't need to do this, but It's a good answer!
What is the format of the .erlang file? Or even better, where can I find documentation about it
It takes erlang terms which are evaluated as if entered in the shell. See here Section 1.7.1 erlang.org/documentation/doc-5.2/doc/getting_started/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.