My erlang cowboy server requires gmake
to run. I can use gmake run
on my OSX machine and run the server. Running make run
works fine too but warns me that I should install gmake
.
When I installed my repo https://github.com/QuantumProductions/tunnel.git on my ubuntu host, I tried to make run
and get an error. There are no packages available for gmake
. How do I install gmake
?
root@marble-pyramid-1:~/tunnel# apt-get install gmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gmake
root@marble-pyramid-1:~/tunnel# ls
erlang.mk Makefile oldh rel relx.config src static tunnel.d
root@marble-pyramid-1:~/tunnel# make run
erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
DEP cowboy
DEP jiffy
mv: cannot stat ‘/root/tunnel/deps/jiffy/ebin/jiffy.app’: No such file or directory
make[1]: Entering directory `/root/tunnel/.erlang.mk/rebar'
./bootstrap
No beam files found.
escript: exception error: undefined function make:files/2
in function erl_eval:do_apply/6 (erl_eval.erl, line 569)
in call from erl_eval:expr/5 (erl_eval.erl, line 243)
in call from escript:eval_exprs/5 (escript.erl, line 856)
in call from erl_eval:local_func/5 (erl_eval.erl, line 467)
in call from escript:interpret/4 (escript.erl, line 774)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_it/1
make[1]: *** [all] Error 127
make[1]: Leaving directory `/root/tunnel/.erlang.mk/rebar'
/root/tunnel
{"init terminating in do_boot",{undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,569}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,118}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
make[1]: Entering directory `/root/tunnel/deps/cowboy'
../../erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
DEP cowlib
DEP ranch
make[2]: Entering directory `/root/tunnel/deps/cowlib'
../../erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
DEPEND cowlib.d
../../erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
ERLC cow_base64url.erl cow_cookie.erl cow_date.erl cow_hpack.erl cow_http.erl cow_http2.erl cow_http_hd.erl cow_http_te.erl cow_mimetypes.erl cow_multipart.erl cow_qs.erl cow_spdy.erl cow_sse.erl cow_uri.erl cow_ws.erl
src/cow_base64url.erl:31: syntax error before: '{'
src/cow_base64url.erl:40: syntax error before: '{'
src/cow_base64url.erl:52: syntax error before: '{'
src/cow_base64url.erl:59: syntax error before: '{'
src/cow_base64url.erl:21: function decode/1 undefined
src/cow_base64url.erl:22: function decode/2 undefined
src/cow_base64url.erl:23: function encode/1 undefined
src/cow_base64url.erl:55: function encode/3 undefined
make[3]: *** [ebin/cowlib.app] Error 1
make[2]: *** [app] Error 2
make[2]: Leaving directory `/root/tunnel/deps/cowlib'
make[1]: *** [deps] Error 2
make[1]: Leaving directory `/root/tunnel/deps/cowboy'
make: *** [deps] Error 2
EDIT: installing erlang-base-hipe
:
root@marble-pyramid-1:~/tunnel# apt-get install erlang-base-hipe
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp javascript-common libc-ares-dev libc-ares2 libjs-node-uuid libssl-dev
libssl-doc libv8-3.14-dev linux-headers-3.13.0-68
linux-headers-3.13.0-68-generic linux-image-3.13.0-68-generic
linux-image-extra-3.13.0-68-generic node-abbrev node-ansi node-archy
node-async node-block-stream node-combined-stream node-cookie-jar
node-delayed-stream node-forever-agent node-form-data node-fstream
node-fstream-ignore node-github-url-from-git node-glob node-graceful-fs
node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile
node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream
node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once
node-osenv node-qs node-read node-read-package-json node-request node-retry
node-rimraf node-semver node-sha node-sigmund node-slide node-tar
node-tunnel-agent node-which zlib1g-dev
Use 'apt-get autoremove' to remove them.
Suggested packages:
erlang-edoc erlang-gs erlang erlang-manpages erlang-doc
The following packages will be REMOVED:
erlang-base
The following NEW packages will be installed:
erlang-base-hipe
0 upgraded, 1 newly installed, 1 to remove and 196 not upgraded.
Need to get 8,030 kB of archives.
After this operation, 2,610 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/universe erlang-base-hipe amd64 1:16.b.3-dfsg-1ubuntu2.1 [8,030 kB]
Fetched 8,030 kB in 0s (16.9 MB/s)
dpkg: erlang-base: dependency problems, but removing anyway as you requested:
erlang-crypto depends on erlang-base (= 1:16.b.3-dfsg-1ubuntu2.1) | erlang-base-hipe (= 1:16.b.3-dfsg-1ubuntu2.1); however:
Package erlang-base is to be removed.
Package erlang-base-hipe is not installed.
erlang-asn1 depends on erlang-base (= 1:16.b.3-dfsg-1ubuntu2.1) | erlang-base-hipe (= 1:16.b.3-dfsg-1ubuntu2.1); however:
Package erlang-base is to be removed.
Package erlang-base-hipe is not installed.
erlang-syntax-tools depends on erlang-base (= 1:16.b.3-dfsg-1ubuntu2.1) | erlang-base-hipe (= 1:16.b.3-dfsg-1ubuntu2.1); however:
Package erlang-base is to be removed.
Package erlang-base-hipe is not installed.
erlang-runtime-tools depends on erlang-base (= 1:16.b.3-dfsg-1ubuntu2.1) | erlang-base-hipe (= 1:16.b.3-dfsg-1ubuntu2.1); however:
Package erlang-base is to be removed.
Package erlang-base-hipe is not installed.
erlang-webtool depends on erlang-base (= 1:16.b.3-dfsg-1ubuntu2.1) | erlang-base-hipe (= 1:16.b.3-d
(Reading database ... 110838 files and directories currently installed.)
Removing erlang-base (1:16.b.3-dfsg-1ubuntu2.1) ...
Searching for services which depend on erlang and should be stopped...none found.
Killing epmd...it is not running.
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Selecting previously unselected package erlang-base-hipe.
(Reading database ... 110469 files and directories currently installed.)
Preparing to unpack .../erlang-base-hipe_1%3a16.b.3-dfsg-1ubuntu2.1_amd64.deb ...
Unpacking erlang-base-hipe (1:16.b.3-dfsg-1ubuntu2.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up erlang-base-hipe (1:16.b.3-dfsg-1ubuntu2.1) ...
Searching for services which depend on erlang and should be started...none found.
root@marble-pyramid-1:~/tunnel# make run
erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
make[1]: Entering directory `/root/tunnel/deps/cowboy'
../../erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
make[2]: Entering directory `/root/tunnel/deps/cowlib'
../../erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
../../erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
ERLC cow_base64url.erl cow_cookie.erl cow_date.erl cow_hpack.erl cow_http.erl cow_http2.erl cow_http_hd.erl cow_http_te.erl cow_mimetypes.erl cow_multipart.erl cow_qs.erl cow_spdy.erl cow_sse.erl cow_uri.erl cow_ws.erl
src/cow_base64url.erl:31: syntax error before: '{'
src/cow_base64url.erl:40: syntax error before: '{'
src/cow_base64url.erl:52: syntax error before: '{'
src/cow_base64url.erl:59: syntax error before: '{'
src/cow_base64url.erl:21: function decode/1 undefined
src/cow_base64url.erl:22: function decode/2 undefined
src/cow_base64url.erl:23: function encode/1 undefined
src/cow_base64url.erl:55: function encode/3 undefined
make[3]: *** [ebin/cowlib.app] Error 1
make[2]: *** [app] Error 2
make[2]: Leaving directory `/root/tunnel/deps/cowlib'
make[1]: *** [deps] Error 2
make[1]: Leaving directory `/root/tunnel/deps/cowboy'
make: *** [deps] Error 2
root@marble-pyramid-1:~/tunnel#
If you look at your output first real error you will find is:
And if you look at line
31
insrc/cow_base64url.erl
(indeps/cowlib/src
) all you will find isThe
#{}
creates a new empty map, which is "new" feature in Erlang (first introduced in R17, now we are on R20). So it makes me think that you are trying to compile your code with an older version of Erlang.Please verify your version of Erlang, you can do by simply running
erl
in your shell:And, if in fact it all was caused by old Erlang distribution, then you can either try to download pre-built binaries from official site or use kerl to easily build your own.