Stuck getting compiling rebar3 errors

You may want to chime in on this issue - same error but on Windows

https://github.com/erlang/rebar3/issues/1562

It seems to be a mix/rebar3 issue.

So in terms of a workaround see if you can compile this dependency with plain erlang/rebar3 and get mix to leave it alone.

I have gone through the link.

Please do you have an idea of how to achieve your suggestion. I’m very new to elixir and I don’t really know how to go about this.

I’d have to “feel” my way through it as well - the priorities I would set:

  • find a “hello world” tutorial project for to learn the basics of using rebar3

  • then use what you’ve learned to compile certifi on Ubuntu

  • Research mix to learn how to include straight binary dependencies (i.e. without any compilation step)

  • Modify your mix configuration to have a dependency on your successfully compiled certifi assets.

Thanks @peerreynders

This is Rebar3 report on my mac

Rebar3 report
 version 3.2.0
 generated at 2017-07-20T19:14:20+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task:
Entered as:

-----------------
Operating System: x86_64-apple-darwin16.6.0
ERTS: Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]
Root Directory: /usr/local/Cellar/erlang/20.0/lib/erlang
Library directory: /usr/local/Cellar/erlang/20.0/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.0.4
certifi: 0.4.0
cf: 0.2.1
common_test: 1.15
compiler: 7.1
crypto: 4.0
cth_readable: 1.2.2
dialyzer: 3.2
edoc: 0.9
erlware_commons: 0.21.0
eunit: 2.3.3
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.4
kernel: 5.3
providers: 1.6.0
public_key: 1.4.1
relx: 3.19.0
sasl: 3.0.4
snmp: 5.2.6
ssl_verify_hostname: 1.0.5
stdlib: 3.4
syntax_tools: 2.1.2
tools: 2.10

-----------------
Escript path: /Users/PAPAKAY/.mix/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref

This shows the version on my local machine that works fine is Rebar 3.2.0

So i’m wondering if i Could downgrade the version of Rebar3 on the server to be 3.2.0 at least for the main time the issue will be resolved.

Is there a way to install a particular version of rebar3 instead of installing the latest?

Thank you so much.

Essentially follow the instructions from Installing from Source BUT use 3.2.0 instead.

Then you could create a symbolic link at /home/deploy/.mix/rebar3 towards the 3.2.0 installation.

BUT before you go ahead - what is the version of mix on both systems? Because mix could be feeding bad arguments to rebar3 - so altering rebar3 may not help.

Then again there was a modification on June 20, in the area where your crash originates (note though that quite often the actual error can occur much further upstream).
https://github.com/erlang/rebar3/commit/c94d3d2a16ccfdb05f81ad235da4910f78c8d573

and 3.4.2 released on July 14.

It may be an idea to find the versions of Erlang, Elixir, mix, rebar3, etc. on your OS X installation and try to get exactly the same versions on Ubuntu - if you make everything current on OS X you may find that you experience the same problems.

Thanks so much @peerreynders.

The version of mix on both system is 1.4.5

Hey @papakay,

sorry for the late reply.

but do you have enough RAM?
I also had to create a Swapfile
Not sure if this will help you, check the replies at the bottom here

1 Like

Thanks so much @dyyce.

I have 512MB of RAM.

I didn’t create a swapfile but i think if that will help solve this problem then I wouldn’t mind doing that.

I’m using $5 plan of DigitalOcean

@peerreynders, @NobbZ, @dyyce.

May the Lord bless you so much in Jesus name, Amen.

You really made my day worth it. It was a very tough challenge but God has used you all to help me resolve this challenge.

As @dyyce mentioned, it happened to be a memory issue. So I follow the recommendation to create a swapfile and everything worked seamlessly.

I appreciate you all and it’s my prayer that God will increase your knowledge and wisdom in Jesus name, Amen.

Cheers.

1 Like

glad we could help you! :smile:

cheers

Hi peerreynders, this also gives solution for those who are having problems with rebar3 running elixir in Windows Subsystem for Linux, when compiling my project in elixir I got the same error message:

** (Mix) Could not compile dependency: certifi – .mix/rebar3 bare compile ,

when i read your comment i remembered that the Subsystem for Linux does not bring all the packages even the minimum installed by default, so doing: sudo apt-get install build-essential, the problem was solved, thanks for your help, Regards.

1 Like

I know this is an old post. I just faced the same issue and I narrowed it down to symlinks.
I was writing the script for CI and symlinking _build and _deps ended up creating this issue.
The current alternative is using mount --bind, which requires sudo, but at least allows caching.

I know this is an old post. But am having this issue at the moment on a gitlab runner environment that helps deploy every commit on gitlab to dokku. I have tried the solution provided by @peerreynders but was still getting the same error. Kindly find the error below.

remote: ** (Mix) Could not compile dependency :hackney, “/app/.mix/rebar3 bare compile --paths=”/tmp/build/_build/prod/lib/*/ebin"" command failed. You can recompile this dependency with “mix deps.compile hackney”, update it with “mix deps.update hackney” or clean it with “mix deps.clean hackney”

I had this error before and I tried to run:
/root/.mix/rebar3 update
/root/.mix/rebar3 upgrade
/root/.mix/rebar update

Then the problem solved. Hope it works for you.