3

当我准备在Windows7上安装rebar3时,我已经从github克隆了代码,然后使用git bash进行安装。但是当我输入命令时,它显示`escript:异常错误:右侧值不匹配:

{error, {malformed_url,xxxx_username,"passwd@proxy.com:8080"}}

我在中国,我在一家封锁我的网络的公司工作。但是我有一个代理,那么如何在 escript 或这种情况下设置代理来解决我的问题?

4

1 回答 1

3

escript只是一些 erlang 代码,no match error当等号右侧的某些内容(即 erlang 中的匹配运算符)与等号左侧的内容不匹配时,就会发生这种情况。这是一个简单的例子:

1> X = 20.
20

2> 3 = X.
** exception error: no match of right hand side value 20

因为3不匹配 的值X,即20,你会得到一个匹配错误,后面跟着右边的值,在这种情况下是 20。

在您的情况下,右侧的值是您发布的元组,这显然是由相关等号右侧的任何表达式返回的错误。例如:

3> {ok, file} = file:open("non-existent", read).
** exception error: no match of right hand side value {error,enoent}

在示例中,file:open()返回一个以 atom 开头的元组error

{error, enoent}

它永远不能匹配以 atom 开头的等号左侧的元组ok

{ok, file}

您运行的 escript 代码中的某些内容创建了malformed_url.

于 2019-01-19T02:39:26.330 回答