If I want to know if erlang was compiled with ssl support I do :
1> ssl:versions().
But how to view the list of available application that were included at compilation time ? I need to as access to the list to include it in an installation checklist.
Thanks to all
You can use application module to do this:
$ erl
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.9.3.1 (abort with ^G)
1> application:which_applications().
[{stdlib,"ERTS CXC 138 10","1.18.3"},
{kernel,"ERTS CXC 138 10","2.15.3"}]
Related
I have been trying to get riak running on a macbook, following the official guide
I have tried pulling the tarball and also installing from source. The result is the same
here is the output from riak console:
config is OK
-config /Users/jistone/riak-2.0.4/rel/riak/data/generated.configs/app.2015.02.16.22.22.49.config -args_file /Users/jistone/riak-2.0.4/rel/riak/data/generated.configs/vm.2015.02.16.22.22.49.args -vm_args /Users/jistone/riak-2.0.4/rel/riak/data/generated.configs/vm.2015.02.16.22.22.49.args
!!!!
!!!! WARNING: ulimit -n is 256; 65536 is the recommended minimum.
!!!!
Exec: /Users/jistone/riak-2.0.4/rel/riak/bin/../erts-5.10.3/bin/erlexec -boot /Users/jistone/riak-2.0.4/rel/riak/bin/../releases/2.0.4/riak -config /Users/jistone/riak-2.0.4/rel/riak/data/generated.configs/app.2015.02.16.22.22.49.config -args_file /Users/jistone/riak-2.0.4/rel/riak/data/generated.configs/vm.2015.02.16.22.22.49.args -vm_args /Users/jistone/erlang/rktar/riak-2.0.4/rel/riak/data/generated.configs/vm.2015.02.16.22.22.49.args -pa /Users/jistone/riak-2.0.4/rel/riak/bin/../lib/basho-patches -- console
Root: /Users/jistone/riak-2.0.4/rel/riak/bin/..
Erlang R16B02-basho5 (erts-5.10.3) [source] [smp:8:8] [async-threads:64] [hipe] [kernel-poll:true]
{"Kernel pid terminated",application_controller,"{application_start_failure,erlang_js,{{bad_return_value,{error,{load_error,\"Failed to load erlang_js_drv.so\"}}},{erlang_js,start,[normal,[]]}}}"}
Crash dump was written to: ./log/erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,erlang_js,{{bad_return_value,{error,{load_error,"Failed to load erlang_js_drv.so"}}},{erlang_js,start,[normal,[]]}}})
erlang_js_drv.so does exist:
$ find ./ -name erlang_js_drv.so
.//lib/erlang_js-1.3.0-0-g07467d8/priv/erlang_js_drv.so
So I'm not sure what the message is about. How can I debug this further?
I'm trying to run a Cowboy web server in Mac OS X 1.9 and I'm getting a stack trace. On a ubuntu box everything runs fine, so I believe this must be something simple to fix if anybody has experienced the problem.
The command:
./_rel/bin/cowfarm command
The stack trace:
Exec: /Users/marcosvm/code/spikes/cowfarm/_rel/erts-5.10.2/bin/erlexec -boot /Users/marcosvm/code/spikes/cowfarm/_rel/releases/1/cowfarm -mode embedded -config /Users/marcosvm/code/spikes/cowfarm/_rel/releases/1/sys.config -args_file /Users/marcosvm/code/spikes/cowfarm/_rel/releases/1/vm.args -- console
Root: /Users/marcosvm/code/spikes/cowfarm/_rel
Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
=INFO REPORT==== 26-Nov-2013::15:08:49 ===
application: cowboy
exited: {bad_return,
{{cowboy_app,start,[normal,[]]},
{'EXIT',
{undef,
[{cowboy_app,start,[normal,[]],[]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},
{line,269}]}]}}}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,cowboy,{bad_return,{{cowboy_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy_app,start,[normal,[]],[]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,269}]}]}}}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,cowboy,{bad_return,{{cowboy_app,start,[normal,[]]},{'EXIT',{undef,[{cowboy_app,start,[normal,[]],[]},{application_master,st
The cowboy application is not in the path:
...
{undef,
[{cowboy_app,start,[normal,[]],[]},
...
maybe you should start the application from another place, or add the path to the cowboy application adding "-pa path/to/cowboy/ebin" where you are calling the erlang vm
I am extremely new to Erlang, I am trying to compile my first Erlang module and am getting an error that the no such file exists, although it does in fact exist.
Any suggestions as to why I erl.exe is failing to compile useless.erl is greatly appreciated.
Many thanks in advance!
erl.exe command prompt (note modules does in fact contain useless.erl)
1> filename:absname("C:/Users/modules").
"C:/Users/modules"
2> c(useless).
useless.erl:none: no such file or directory
(useless.erl)
-module(useless).
-export([add/2, hello/0, greet_and_add_two/1]).
add(A,B) ->
A + B.
%% Shows greetings.
%% io:format/1 is the standard function used to output text.
hello() ->
io:format("Hello, world!~n").
greet_and_add_two(X) ->
hello(),
add(X,2).
With that form, you need to execute erl the same directory as the module you are trying to compile. You can specify a file path when you use the c function. This will create a .beam file in your current directory:
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.1 (abort with ^G)
1> c("stackoverflow/passfun.erl").
{ok,passfun}
2> passfun:some_func().
hello
Does Erlang R15B02 have support for hybrid heap?
I run configure --enable-hybrid-heap blabla... and make it, but no [hybrid-heap] flag showing:
$ erl
Erlang R15B02 (erts-5.9.2) [source] [64-bit halfword] [smp:16:16] [async-threads:0] [kernel-poll:false]
I get to know this flag from here: https://stackoverflow.com/a/1185490/940313
The experimental Hybrid heap implementation is gone in R15B02:
OTP-10105 Remove all code, documentation, options and diagnostic
functions which were related to the experimental hybrid heap
implementation.
See http://www.erlang.org/download/otp_src_R15B02.readme
I would like to develop a web application in Erlang, so I installed Yaws 1.92 on Windows 7.
But when I try to start Yaws with both yaws and yaws -i I get this error message:
C:\Users\Jonas>yaws
{"init terminating in do_boot",{undef,[{yaws,start,[]},{init,start_it,1},{init,s
tart_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
C:\Users\Jonas>
Is there anything I'm missing? How can I solve this?
With the help from Steve's suggestion, I realised that my Erlang runtime was too old. I upgraded from R14B to R15B. Now Yaws starts, but it still prints some erros on startup:
C:\Users\Jonas>yaws
Eshell V5.9 (abort with ^G)
1>
=INFO REPORT==== 2-Feb-2012::16:22:13 ===
Yaws: Using config file C:\Program Files (x86)\Yaws-1.92\yaws.conf
1>
=ERROR REPORT==== 2-Feb-2012::16:22:13 ===
'auth_log' global variable is deprecated and ignored. it is now a per-server var
iable1>
=INFO REPORT==== 2-Feb-2012::16:22:13 ===
Reading .yaws_auth c:/Program Files (x86)/Yaws-1.92/www/authtest/auth_in_dot_yaw
s_auth/abc/.yaws_auth
1>
=ERROR REPORT==== 2-Feb-2012::16:22:13 ===
Cannot open "c:/Program Files (x86)/Yaws-1.92/logs/localhost.8080.auth"1>
=ERROR REPORT==== 2-Feb-2012::16:22:13 ===
Cannot open "c:/Program Files (x86)/Yaws-1.92/logs/localhost.8080.access"1>
=INFO REPORT==== 2-Feb-2012::16:22:14 ===
Ctlfile : c:/Users/Jonas/AppData/Local/Temp/yaws/default/CTL
1>
=INFO REPORT==== 2-Feb-2012::16:22:14 ===
Yaws: Listening to 0.0.0.0:8080 for <1> virtual servers:
- http://localhost:8080 under c:/Program Files (x86)/Yaws-1.92/www
1>
Any suggestion on why I get so many errors? and how to solve them?
The undef there is saying that the function yaws:start/0 isn't found. Seems like it may be a problem with the load path.
Try starting yaws like this:
yaws -i -erlarg "-boot start_sasl"
Hopefully that will give you more verbose output to help you track down the problem.