Unable to compile phoenix project due to caching of dependencies

Hi Guys, I am still learning elixir and phoenix. I was about to create a new project from a different machine I was using but I was unable to because the compiling is taking a unusual amount of time. May I ask an advise from you guys what steps should I do to have the compiling move forward.

==> connection
Compiling 1 file (.ex)
Generated connection app
==> rumbl
Could not find "rebar3", which is needed to build dependency :fs
I can install a local copy which is just used by Mix
Shall I install rebar3? (if running non-interactively, use: "mix local.rebar --force") [Yn] Y
* creating /home/jcmacariola/.mix/rebar
* creating /home/jcmacariola/.mix/rebar3
===> Fetching pc ({pkg,<<"pc">>,<<"1.5.0">>})
===> Downloaded package, caching at /home/jcmacariola/.cache/rebar3/hex/default/packages/pc-1.5.0.tar

Hello! I’ve got the same problem. I generated new Phoenix project, run mix phoenix.server and it’s stuck at the line you mentioned (“Downloaded package, …”). The beam.smp process is taking ~80% CPU.

It’s happening with me too. Is this related to the following issue?

The problem seems to be in rebar3. Try to download the package manually from https://github.com/erlang/rebar3/releases/tag/3.2.0, put it into ~/.mix/ and set execute permissions (chmod +x ~/.mix/rebar3). It hepled in my case.

I downloaded that version of rebar and tried again, but hit issues related to getup

===> Compiling pc
===> Fetching rebar3_hex ({pkg,<<"rebar3_hex">>,<<"3.1.0">>})
===> Downloaded package, caching at /Users/sam/.cache/rebar3/hex/default/packages/rebar3_hex-3.1.0.tar
===> Compiling rebar3_hex
===> Compiling fs
===> Compiling /Users/sam/phoenix/again3/deps/fs/c_src/mac/cli.c
===> /Users/sam/phoenix/again3/deps/fs/c_src/mac/cli.c:1:10: fatal error: 'getopt.h' file not found
#include <getopt.h>
1 error generated.

** (Mix) Could not compile dependency :fs, "/Users/sam/.mix/rebar3 bare compile --paths "/Users/sam/phoenix/again3/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile fs", update it with "mix deps.update fs" or clean it with "mix deps.clean fs"

The issue was with an update of the rebar3 version you install when running mix local.rebar. I have reverted back to a version that does not have the issue and have reported the issue to the rebar3 team.


Thanks for that, is my getopt problem a separate issue? I can start a new thread if so

Yes, it’s a separate issue. I don’t know why it’s happening, getopt should be available on OSX afaik.