Syntax error: "(" unexpected. Node is not running

So I make a release of my app using distillery, after a successful release I take the my_app.tar.gz and copy the file to my ubuntu server (16.04), then I extract the newly uploaded file and start my app like this to check that everything is ok:

./bin/my_app foreground

I choose distillery because there was no need to install erlang and elixir, but what is going on here?? Is this a dependency issue? If there is how can I fixed?

This is my config.exs

Path.join(["rel", "plugins", "*.exs"])
  |> Path.wildcard()
  |> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
  default_release: :default,
  default_environment: Mix.env()

environment :dev do
  set dev_mode: true
  set include_erts: false
end

environment :prod do
  set include_erts: true
  set include_src: false
end

release :my_app do
  set version: current_version(:my_app)
end

PS: node is installed on the server.

**** EDIT ****

I’m trying to build my release on ubuntu 14.04 (Virtual machine) and I’m getting this error:

Check your digested files at "priv/static"
Building release with MIX_ENV=prod.
** (FunctionClauseError) no function clause matching in Mix.env/1
    (mix) lib/mix.ex:213: Mix.env("prod")
    lib/exrm/utils/utils.ex:19: ReleaseManager.Utils.with_env/2
    lib/mix/tasks/release.ex:164: Mix.Tasks.Release.generate_sys_config/1
    lib/mix/tasks/release.ex:74: Mix.Tasks.Release.do_run/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (elixir) lib/enum.ex:645: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:645: Enum.each/2
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3

Any ideas?

1 Like

You get this when you are running mix release?

If so, are you able to do MIX_ENV=prod mix compile just to make sure you can compile in production mode first successfully?

1 Like

I was able to make the release on ubuntu 14.04 (VM) now my app is running on production, but I’m having problems with websockets (Different error)…

Nevertheless I will like to know how can I make the release from mac osx and make it work on ubuntu server 16.04, is there any special configuration or something that I’m missing from the docs?

1 Like

A release has to be built on the same system config as what it will be deployed to because there is native code that has to be compiled for the right libraries and such, this is pretty universal regardless of the compiled language you use when there is native code involved. :slight_smile:

Thus, use a VM. ^.^

1 Like

Try to set in file rel/confix.exs attribute include_erts to false

environment :prod do
  set include_erts: false
  set include_src: false
  set cookie: :"blabla"
end
1 Like