【erlang】rebar3创建、编译报错:badarg

先上结论,有两种可能:

1. git的user.name使用了中文

通过git config use.name ‘myname’ 改成英文

2. 没有以管理员身份运行命令行工具

详情

在使用rebar3的时候,无论是编译还是创建erlang项目,都会有提示错误,说是有非法的参数

rebar3 new app myapp
......
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: badarg

但是查看rebar3.crashdump,发现错误信息只有下边这两行

//rebar3.crashdump
Error: badarg
[]

后边查询资料,发现没有和我相同问题的,判断应该是我这边配置的问题。加上debug=1后执行,发现中间有很多获取本地git的use.name use.email配置的信息,然后我查看这两个配置,发现user.name是中文,怀疑是编码的问题,修改后果然好了。

debug=1 rebar3 new app myapp
===> Expanded command sequence to be run: [{default,new}]
===> Provider: {default,new}
===> Available templates: [{"app",escript,
                                   "rebar/priv/templates/app.template"},
                                  {"cmake",escript,
                                   "rebar/priv/templates/cmake.template"},
                                  {"escript",escript,
                                   "rebar/priv/templates/escript.template"},
                                  {"lib",escript,
                                   "rebar/priv/templates/lib.template"},
                                  {"plugin",escript,
                                   "rebar/priv/templates/plugin.template"},
                                  {"release",escript,
                                   "rebar/priv/templates/release.template"},
                                  {"umbrella",escript,
                                   "rebar/priv/templates/umbrella.template"}]

===> Available templates: [{"app",escript,
                                   "rebar/priv/templates/app.template"},
                                  {"cmake",escript,
                                   "rebar/priv/templates/cmake.template"},
                                  {"escript",escript,
                                   "rebar/priv/templates/escript.template"},
                                  {"lib",escript,
                                   "rebar/priv/templates/lib.template"},
                                  {"plugin",escript,
                                   "rebar/priv/templates/plugin.template"},
                                  {"release",escript,
                                   "rebar/priv/templates/release.template"},
                                  {"umbrella",escript,
                                   "rebar/priv/templates/umbrella.template"}]

===> sh info:
        cwd: "d:/Data/Erlang"
        cmd: git config --global user.name

===>    opts: [return_on_error]

===> Port Cmd: cmd /q /c git config --global user.name
Port Opts: [exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof,binary]
........

===> Executing template file "app.erl"
===> File "myapp/src/myapp_app.erl" already exists
===> Executing template file "sup.erl"
===> File "myapp/src/myapp_sup.erl" already exists
===> Executing template file "otp_app.app.src"
===> File "myapp/src/myapp.app.src" already exists
===> Executing template file "app_rebar.config"
===> File "myapp/rebar.config" already exists
===> Executing template file "gitignore"
===> File "myapp/.gitignore" already exists
===> Executing template file "LICENSE"
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: badarg
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值