这是一个简单的过程:
确保使用 Basho 的 Erlang 补丁版本。在Installing Basho Erlang/OTP 上可以找到相关说明。
然后按照Creating a Nitrogen project 的说明安装精简版。 请使用“slim-release”版本,以便您使用 Basho 的 Erlang 构建项目
从 github 拉取 riak-erlang-client。更多信息Check here 或直接从 ../$MYPROJECT/lib 目录执行此操作,其中 $MYPROJECT 是您的氮气项目名称。 git clone git://github.com/basho/riak-erlang-client.git。这将包括 lib 目录中的 riak-erlang-client
通过 nano ../$MYPROJECT/rebar.config 编辑 rebar.config 文件以包含 riak-erlang-client 依赖项。 ** 在下面的代码块中寻找riakc dep **,在这个项目中我使用了make slim_cowboy
{部门,[
{cowboy, ".*", {git, "git://github.com/ninenines/cowboy", {tag, "1.0.0"}}},
%% Uncomment the following lines and comment the bottom lines with specific
%% tags to always pull the latest versions
{simple_bridge, ".*", {git, "git://github.com/nitrogen/simple_bridge",{branch, master}}},
{nprocreg, ".*", {git, "git://github.com/nitrogen/nprocreg", {branch, master}}},
{nitrogen_core, ".*", {git, "git://github.com/nitrogen/nitrogen_core",{branch, master}}},
%% The riak-erlang-client dep starts
{riakc, "1.4.1", {git, "git://github.com/basho/riak-erlang-client", {tag, "1.4.1"}}},
%% The riak-erlang-client dep ends
{sync, ".*", {git, "git://github.com/rustyio/sync", {branch, master}}}
%% Get specific tagged version
%{simple_bridge, ".*", {git, "git://github.com/nitrogen/simple_bridge",{tag, "v2.0.0-beta5"}}},
%{nprocreg, ".*", {git, "git://github.com/nitrogen/nprocreg", {tag, "v0.2.1"}}},
%{nitrogen_core, ".*", {git, "git://github.com/nitrogen/nitrogen_core",{tag, "v2.3.0-beta6"}}},
%{sync, ".*", {git, "git://github.com/rustyio/sync", {tag, "4dbe32bb4"}}}
]}。
从 ../$MYPROJECT 使用 make all 重新编译您的项目。
在此步骤结束时,只需通过./bin/nitrogen console 启动氮气。尝试通过{ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", <PORT>). 连接到您的 riak 节点之一,然后您就可以开始了。