I have Erlang/OTP 19 [erts-8.3.5] and runtime_tools included in release, rel/reltool.config.script: [tools, runtime_tools];, but when I trying using dbg I got
error: dbg:tracer().
** exception error: undefined function dbg:tracer/0
Looks like dbg module is not included to my application
(ejabberd#localhost)4> m(dbg).
** exception error: undefined function dbg:module_info/0
I want use erlang easy profiler, that I successfully used on erl 16
Does anyone faced with this problem?
Related
I am trying to install ChicagoBoss based on the instructions here. Now, Make is failing with exception -
=ERROR REPORT==== 14-Dec-2022::11:15:33.605319 ===
beam/beam_load.c(148): Error loading module rebar:
please re-compile this module with an Erlang/OTP 25 compiler
escript: exception error: undefined function rebar:main/1
in function escript:run/2 (escript.erl, line 750)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
make: *** [compile] Error 127
I have further installed rebar3 using command -
homebrew install rebar3
I am running Erlang OTP/25 in mac. I haven't been able to understand if it's a problem with
rebar3
or
ChicagoBoss
The problem is with ChicagoBoss. It includes a rebar binary that was compiled with Erlang/OTP release 17, but Erlang/OTP release 25 can only use modules compiled with release 21 or later.
The rebar binary starts with the line #!/usr/bin/env escript, meaning that it looks for escript in the PATH. This picks up release 25, causing this problem. You could try installing release 24 or earlier to work around this.
You might find ASDF useful for switching between Erlang versions: https://github.com/asdf-vm/asdf-erlang
I am unable to use ejabberd_auth in my helloworld project.
-behaviour(ejabberd_auth).
...
....
try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).
With that I get the error warning:
helloworld.erl:15: Warning: behaviour ejabberd_auth undefined
-import(ejabberd_auth, [try_register/3]).
...
....
try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).
With this I get:
exception error: undefined function ejabberd_auth:try_register/3
Why am I unable to access ejabberd_auth?
I am using IntelliJ Idea, with the Erlang plugin installed.
Thank you all in advance.
UPDATE:
I'm on Ubuntu 16.04 LTS
I can get you past that error. Here's how...
When I compile a module in the erlang shell, the compiler creates a .beam file in the same directory, which allows me to call functions defined in the module. In your case, if you cd into the directory:
.../ejabberd/ebin
you will see all the ejabberd .beam files, including ejabberd_auth.beam. If you start an erlang shell in that directory, then issue your function call (don't compile anything), you won't get that error anymore.
But, then I get the error:
exception error: undefined function jid:nodeprep/1
in function ejabberd_auth:validate_credentials/3 (src/ejabberd_auth.erl, line 796)
in call from ejabberd_auth:try_register/3 (src/ejabberd_auth.erl, line`
There is no jid.beam file in that directory. But:
~/Downloads/ejabberd$ find . -name jid.beam
./deps/xmpp/ebin/jid.beam
You are going to have to figure out how to compile your module so that all the ejabberd modules are available to your program. See: ejabberd how to compile new module.
I am unable to use ejabberd_auth in my helloworld project.
Are you following a tutorial somewhere?
I have my server running with
make run
Then I edited a file. Back in the cowboy terminal I type
(tunnel#127.0.0.1)2> c(clock).
Recompiling /root/tunnel/src/clock.erl
** exception error: undefined function compile:file/2
in function c:compile_and_load/2 (c.erl, line 259)
in call from c:safe_recompile/3 (c.erl, line 235)
(tunnel#127.0.0.1)3> compile(clock).
it seems that the shell recognizes the compile shortcut but it lists it as undefined.
How do I recompile while the server is running?
I also tried erlc src/clock.erl, which gave me a warning using export all but didn't respond with any error.
I started learning Erlang, after read first chapter got strange error during compilation of module.
So when I try to compile demo.erl
-module(demo).
-author("alex").
-export([double/1]).
double(Value) ->
Value * 2.
So I try to compile it
1> m(demo).
and got
** exception error: undefined function demo:module_info/0
The only way to compile was
make:files(filelib:wildcard("demo.erl")).
I got demo.beam and now even after deletion of it m(demo). begin work.
Can anyone explain to me that compiler behavior?
To compile a module from the Erlang shell, use the c command:
1> c(demo).
{ok,demo}
The shell m command is for retrieving information about a compiled module:
2> m(demo).
Module: demo
MD5: 422cee9099e136c6dec13dd200927c63
Compiled: December 12 2015, 22:51
Object file: /tmp/demo.beam
Compiler options: []
Exports:
double/1
module_info/0
module_info/1
ok
I'm install ejabberd 2.1.13 from binary installer.
After module compilation and copying *.beam files to /opt/ejabberd_2.1.13/lib/ejabberd_2.1.13/ebin directory ejabberd crushes with this error (also with undef error):
=ERROR REPORT==== 2014-08-25 16:45:07 ===
beam/beam_load.c(1365): Error loading module mod_archive_odbc:
use of opcode 153; this emulator supports only up to 152
Erlang OTP version is R17.
I've also tried to install R15B1 on VM and compile module on it. After copying beam files i still see the same error.
What should i do to make it work?
UPD: I've tried to build mod on R14B04 and get this error from compiler:
=ERROR REPORT==== 26-Aug-2014::15:30:32 ===
beam/beam_load.c(1365): Error loading module gen_mod:
use of opcode 153; this emulator supports only up to 152
I decided to checkout the repository from SVN (instead of GIT). Module compiles without errors (on R14B04). Server starts without error logs and warnings. Yep, it Works!