我试图在Elixir项目中使用Erlang库时遇到一个小问题.有问题的库是erl8583ISO-8583消息打包和解包.
我找到了一个github存储库erl8583,并将我调整mix.exs为以下内容:
defmodule Iso.Mixfile do
use Mix.Project
def project do
[app: :iso,
version: "0.0.1",
elixir: "~> 1.0",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps]
end
def application do
[applications: [:logger]]
end
defp deps do
[{:erl8583, github: "mgwidmann/erl8583"}]
end
end
Run Code Online (Sandbox Code Playgroud)
当我运行mix deps.get和mix deps.compile,它运行平稳.
然后,我尝试启动IEx会话iex -S mix,并收到以下错误:
Unchecked dependencies for environment dev:
* erl8583 (git://github.com/mgwidmann/erl8583.git)
could not find an app file at _build/dev/lib/erl8583/ebin/erl8583.app. This may happen if …Run Code Online (Sandbox Code Playgroud) 我有一个非常简单的Elixir代码示例,我想在不同的节点上运行.
第一个节点在我的笔记本电脑上,第二个节点是Raspberry Pi,通过SSH访问.
代码很简单:
# node1@my-computer
defmodule Hello do
def world, do: IO.puts "hello world"
end
# node2@raspberrypi
iex> Node.spawn_link :"node1@my-computer", fn -> Hello.world end
Run Code Online (Sandbox Code Playgroud)
我预计Node.spawn_link会"hello world"在Raspberry Pi上打印,但它显示错误说** (EXIT from #PID<0.66.0>) no connect
在具有两个不同iex实例的同一台机器上,此代码工作正常.
我开始对IEx标志会node1用iex --sname node1 --cookie secret和node2用iex --sname node2 --cookie secret.
值得注意的是,在我的Raspberry Pi上iex,这个警告开头:
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as …
我有一个mix.exs具有一些依赖项的文件:
def deps do
[{:nadia, "~> 0.4"}]
end
Run Code Online (Sandbox Code Playgroud)
假设我想将Nadia改为版本0.3.我很难做到这一点.
在进行更改后mix.exs,我无法获得Nadia的0.3版本.既不帮助我mix deps.update也不mix deps.unlock && mix deps.update帮助我.
我确信有办法做到这一点; 我找不到它.
提前致谢!