Попытки запустить учебник образцов для RabbitMQ в Erlang под OSX, но он выдает следующее сообщение:Не может найти включать Lib «rabbit_common/включить/rabbit.hrl» в ковбойской
./send.erl:20: can't find include lib "rabbit_common/include/rabbit.hrl"
./send.erl:21: can't find include lib "rabbit_common/include/rabbit_framing.hrl"
escript: There were compilation errors.
amqp_example.erl:
-module(amqp_example).
-include("amqp_client.hrl").
-compile([export_all]).
test() ->
%% Start a network connection
{ok, Connection} = amqp_connection:start(#amqp_params_network{}),
%% Open a channel on the connection
{ok, Channel} = amqp_connection:open_channel(Connection),
%% Declare a queue
#'queue.declare_ok'{queue = Q}
= amqp_channel:call(Channel, #'queue.declare'{}),
%% Publish a message
Payload = <<"foobar">>,
Publish = #'basic.publish'{exchange = <<>>, routing_key = Q},
amqp_channel:cast(Channel, Publish, #amqp_msg{payload = Payload}),
%% Get the message back from the queue
Get = #'basic.get'{queue = Q},
{#'basic.get_ok'{delivery_tag = Tag}, Content}
= amqp_channel:call(Channel, Get),
%% Do something with the message payload
%% (some work here)
%% Ack the message
amqp_channel:cast(Channel, #'basic.ack'{delivery_tag = Tag}),
%% Close the channel
amqp_channel:close(Channel),
%% Close the connection
amqp_connection:close(Connection),
ok.
Пожалуйста, помогите мне решить эту проблему. Спасибо !!!
Здравствуйте @tkowal, Как я могу добавить файл rabbit_common- [версия] /include/rabbit.hrl в пути ERL_LIBS? –
Вы должны добавить каталог deps, добавив 'ERL_LIBS = deps' перед вашей командой. Затем, если вы распакуете файл 'deps/rabbit_common-3.3.5/include/rabbit.hrl', он найдет его. – tkowal
Спасибо за ваш helpul @tkowal, он работает сейчас. :) –