初学者安装模块最简单的方法是什么? [英] What is the easiest way for beginners to install a module?

查看:63
本文介绍了初学者安装模块最简单的方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我签出了钢筋,但这似乎太复杂了。也许有人可以在以下钢筋应用程序中发布如下内容:%在此处发布您的代码

I checked out rebar, but that seems way too complex. Maybe someone could post something that says, %Post your code here in the following rebar app:

%%%-------------------------------------------------------------------
%% @doc myapp public API
%% @end
%%%-------------------------------------------------------------------

-module('myapp_app').

-behaviour(application).

%% Application callbacks
-export([start/2
        ,stop/1]).

%%====================================================================
%% API
%%====================================================================

start(_StartType, _StartArgs) ->
    'myapp_sup':start_link().

%%--------------------------------------------------------------------
stop(_State) ->
    ok.

对于初学者,有没有更简单的选择?

Is there some easier alternative for beginners?

推荐答案

如果您要创建任何非平凡的东西,就无法逃避学习语言构建系统的麻烦。如果您熟悉GNU Make,则可以使用 erlang.mk 代替Rebar,但是我相信Rebar3是最入门的-

You cannot escape having to learn your language's build system if you're going to create anything non-trivial. If you are familiar with GNU Make you can use erlang.mk instead of Rebar, but I believe Rebar3 is the most beginner-friendly.

要解决在REPL中运行某人的库代码的特定问题,请尝试使用rebar3进行以下操作: / p>

To solve the specific problem of running someone's library code inside of the REPL, try the following with rebar3:


rebar3新应用

rebar3 new app

忽略源它现在创建的文件。编辑 rebar.config 添加依赖项。然后,启动一个加载了那些依赖关系的REPL(以及您在 src / 目录中创建的任何源文件):

Ignore the source files that it creates for now. Edit rebar.config and add dependencies. Then, launch a REPL that has those dependencies loaded (along with any source files you've created in the src/ directory):


rebar3 shell

rebar3 shell

这篇关于初学者安装模块最简单的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆