Env: rebar 3.6.0 on Erlang/OTP 21 Erts 10.0 Ubuntu 16.04
When I try to install the rebar3 pulgins (such as rebar3_hex), it reports:
===> Package <<"rebar3_hex">> not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Plugin rebar3_hex not available. It will not be used.
There is only one line in my ~/.config/rebar3/rebar.config:
{plugins, [rebar3_hex]}.
as recommended in https://www.rebar3.org/docs/using-available-plugins#hex-package-management and https://github.com/tsloughter/rebar3_hex.
I can't get more useful information from google, rebar3 doc and existed question here.
So, I open a new question to ask Why and How to resolve it.
ps: I use proxychains for rebar3, it reports |DNS-response| repo.hex.pm is 151.101.54.2
inet_gethost[10708]: WARNING:Malformed reply (header) from worker process 10709.
In my case, it's fixed when set proxy environmental variable(http_proxy) instead of use proxychains.
Related
Background
I have created a project using mix phx.new my_app --no-ecto and everything looked fine. However I am not able to run the created project.
Error
When I execute mix phx.server (after running mix deps.get)I get the following error:
===> Compiling ranch
===> Command ' OTP' not found in namespace bare
** (Mix) Could not compile dependency :ranch, "/home/user/.asdf/installs/elixir/1.7.3-otp-21/.mix/rebar3 bare compile --paths "/home/user/Workspace/exercises/islands_interface/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile ranch", update it with "mix deps.update ranch" or clean it with "mix deps.clean ranch"
OS and Language Info
Distributor ID: Ubuntu
Description: Ubuntu 19.04
Release: 19.04
Codename: disco
elixir 1.7.3-otp-21
erlang 21.1
What am I doing wrong?
I just found out what the error was.
This is the absolute path of the project:
/home/user/Workspace/Functional Web Development with Elixir, OTP, and Phoenix/islands_interface
Turns out, phx.server errors out because it is inside the folder /Functional Web Development with Elixir, OTP, and Phoenix/. Turns out that space in ' OTP' in the error message is from the folder's name.
To prove my theory I created a project called test under /home/user/Workspace/. Everything worked perfectly.
Further investigation revealed the source of the problem. A Phoenix dependency, rebar3, has a bug with folders that have commas in their names.
https://elixirforum.com/t/phoenix-could-not-compile-dependency-ranch/22939/16?u=fl4m3ph03n1x
I've always been able to compile sources from git repository https://github.com/GNOME/vala.git on my PC running "Linux Mint 18.3 Cinnamon 64-bit". I have the latest valac (0.42.4-0ubuntu1~16.04~valateam0) installed.
The last successful compile I did was from version 0.40.0.257-40b5-dirty. Today, I downloaded the latest vala.git, but when i run ./configure I get:
./configure: line 12579: syntax error near unexpected token `$flag,TEST_CFLAGS="$TEST_CFLAGS $flag"'
./configure: line 12579: ` AX_CHECK_COMPILE_FLAG($flag,TEST_CFLAGS="$TEST_CFLAGS $flag")'
Do I need to make additional environment changes? Not sure were to go from here.
Compiling Vala from source is a good start in contributing back to the Vala project. Vala currently uses autotools as its build system. For Ubuntu AX_CHECK_COMPILE_FLAG is provided by a separate package: autoconf-archive. See the autotools syntax error with ax_check_compile_flag answer on Stack Overflow for more details. So you should just need to install autoconf-archive.
By the way the main repository for Vala is in GNOME's GitLab instance: https://gitlab.gnome.org/GNOME/vala You may want to clone that one instead. The GitLab instance also allows issues to be raised and merge requests to be submitted.
I wish to use an erlang client library to communicate with an mqtt broker for one of my projects. So I've started an application using rebar3's built-in templates and added emqttc as a dependency. Since erlang/otp 21 does not have support for gen_logger(emqttc depends on gen_logger) and the tuple_calls compiler options do not suffice, I had to downgrade to erlang#20 according to this post.
Now the issue with downgrading erlang is that, none of rebar3's commands(clean/compile/shell/report etc) work as expected and my previous projects built with rebar3 do not compile, I get to see this error message:
=ERROR REPORT==== 21-Aug-2018::12:54:29 === Loading of /usr/local/bin/rebar3/rebar/ebin/rebar3.beam failed: badfile escript:
exception error: undefined function rebar3:main/1 in function
escript:run/2 (escript.erl, line 759) in call from escript:start/1
(escript.erl, line 277) in call from init:start_em/1 in call from
init:do_boot/3
=ERROR REPORT==== 21-Aug-2018::12:54:29 === beam/beam_load.c(1863): Error loading module rebar3: This BEAM file was compiled for a later
version of the run-time system than 20. To fix this, please
recompile this module with an 20 compiler. (Use of opcode 160; this
emulator supports only up to 159.)
I've uninstalled and reinstalled rebar3, looked up on the web for this but nothing's clear and specific to rebar. Any help on this would be appreciated.
This may not be the exact answer for your question. But it may give you and idea.
What about using Docker. Its an easy way to keep your environment clean and neat.
If you use docker, you just have to include your new erlang version in Dockerfile as an environment variable.
ENV OTP_VERSION="20.3.6"
Check your _build/prod/rel/YOURAPPNAME/ directory. Most probably it has a release which doesn't match your erlang version. You can safely delete this directory and rebuild using rebar3 compile
I am running Yaws server version 2.0.2 with Erlang/OTP 18 [erts-7.3] on ubuntu 16.04 and installed it using apt. Now when i try to run this example i get
undef yaws_dynopts random_seed. I have verified that module yaws_dynopts is not loaded OR compiled.
error is:
{undef,[{yaws_dynopts,random_seed,[6885,441906,806568],[]},
{m1,'-out/1-fun-0-',1,
[{file,"/home/my_account/.yaws/yaws/default/m1.erl"},{line,16}]}]}
which corresponds to line in example:
yaws_dynopts:random_seed(erlang:phash(node(), 100000),
erlang:phash(A2, A3),
A3),
Do anyone have solution to this? And is it a bug?
Does l(yaws_dynopts). also cause an error? I'm starting to believe whoever packaged your version of Yaws didn't do it correctly, leaving out this critical module. You should look to see if version 2.0.3 is available, or alternatively consider building your own from source. We're currently at 2.0.4.
I am new to Erlang, I have been trying to install Erlang and ejabberd on EC2 ubuntu machine, everything went well till I started compiling some external modules in ejabberd. It started throwing error undefined parse transform 'lager_transform'.
I tried everything which is as below:
Did rebar get-deps, make clean, make deps, make install. After this I am able to see that lager_transform.beam is made and present in /lib/ folder.
Checked rebar.config file, it had lager deps on top, which is widely suggested, no help even after that.
Added -compile[{parse_tranform},{lager_transform}] on top of module, even then their is no luck.
I am really blocked on this, and not able to complete the installation. I have done this before on fedora with ejabberd 15.11 and otp 18.2, at that time it was using p1_logger instead of lager. But now when I am installing fresh with otp 18.2 and ejabberd 16.0 or 15.11, I am getting lager_transform undefined error.
Please make sure you compile ejabberd as described in documentation: http://docs.ejabberd.im/admin/guide/installation/#installing-ejabberd-from-source-code
For example, you can compile it with:
./configure --enable-lager --enable-mysql
make
You need to run configure and make to set properly the build chain.