I'm trying to create a standalone executable using mix escript.build. It seems to work, but when I run it. I get this:
** (EXIT from #PID<0.49.0>) an exception was raised:
** (ArgumentError) argument error
:erlang.++({:error, :bad_name}, '/ale')
lib/i2c.ex:59: I2c.init/1
(stdlib) gen_server.erl:306: :gen_server.init_it/6
(stdlib) proc_lib.erl:239: :proc_lib.init_p_do_apply/3
What its trying to do is run another executable called ale. This works fine when I do things from iex -S mix. The dependencies I'm using is called elxir_ale (
http://github.com/fhunleth/elixir_ale). The executable (ale) is in the priv directory under the _build directory. I thought I read somewhere that mix is supposed to create a symlink to embedded executables like ale, but I don't see that being done. Here's my mix.ex:
defmodule ExGoPiGo.Mixfile do
use Mix.Project
def project do
[app: :exgopigo,
version: "0.0.1",
name: "ExGoPiGo",
elixir: "~> 1.0",
# build_embedded: Mix.env == :prod,
# start_permanent: Mix.env == :prod,
escript: escript_config,
deps: deps]
end
# Configuration for the OTP application
#
def application do
[applications: [:logger, :elixir_ale]]
end
# Dependencies can be Hex packages:
#
# {:mydep, "~> 0.3.0"}
#
# Or git/path repositories:
#
#
# Type `mix help deps` for more examples and options
defp deps do
[
{ :elixir_ale, "~> 0.3.0" },
{ :ex_doc, github: "elixir-lang/ex_doc" }
]
end
defp escript_config do
[main_module: ExGoPiGo]
end
end
Any thoughts on what I'm missing?
Thanks,
Rod