4

I'm trying to go through the Up And Running tutorial on the Phoenix framework site. I have the following setup :

  • macOS 10.14.5
  • Phoenix 1.4.6
  • Elixir 1.8.2
  • Erlang/OTP 22

I create the project with the mix phx.new command. I get prompted to fetch and install the dependencies. I type Y. The dependencies get fetched and installed successfully.

I go to my project directory and enter the following command :

mix ecto.create

The following error appears :

(Mix) Could not compile dependency :ranch, "/Volumes/Macintosh HD/Users/mark/.mix/rebar3 bare compile --paths "/Code/hello/_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"

I get the same error if I run mix phx.server.

If I run mix deps.clean ranch and mix deps.update ranch, it lists the following unchanged dependencies:

Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  connection 1.0.4
  cowboy 2.6.3
  cowlib 2.7.3
  db_connection 2.0.6
  decimal 1.7.0
  ecto 3.1.4
  ecto_sql 3.1.3
  file_system 0.2.7
  gettext 0.16.1
  jason 1.1.2
  mime 1.3.1
  phoenix 1.4.6
  phoenix_ecto 4.0.0
  phoenix_html 2.13.2
  phoenix_live_reload 1.2.0
  phoenix_pubsub 1.1.2
  plug 1.8.0
  plug_cowboy 2.0.2
  plug_crypto 1.0.0
  postgrex 0.14.3
  ranch 1.7.1
  telemetry 0.4.0

So ranch has been compiled. But when I run mix ecto.create again, I get the same error about being unable to compile dependency :ranch.

I did an Internet search to see if anyone else had the same issue. Every issue someone had with mix ecto.create involved creating database users. No one else had an issue with ranch.

What do I have to do to get the Up and Running tutorial running properly?

Swift Dev Journal
  • 19,282
  • 4
  • 56
  • 66

1 Answers1

1

I've run into this problem under Ubuntu, and the issue was that the ~/.configure folder was unreadable by my current user. Changing the owner and group on that folder and it's contents solved the problem for us.

I was able to recreate this problem under MacOS, using Elixir 1.7.4 and Erlang 20.1 by changing the permissions on my ~/.config folder to 600. Setting the permissions back to 755 allowed the compile.

philosodad
  • 1,808
  • 14
  • 24
  • On the Mac, there is a ~/.config folder. My user is the owner of that folder. I tried going through the tutorial again, running macOS 10.14.5, and the error still persists. – Swift Dev Journal May 23 '19 at 01:18
  • @MarkSzymczyk I was able to recreate this problem under MacOS, Elixir 1.7.4, and Erlang 20.1 by changing the permissions on my ~/.config folder to 600. When I do this, I get the ranch compile error. Changing the permissions back to 755 allows compilation of ranch. What are the permissions on your ~/.config folder? – philosodad May 23 '19 at 01:33
  • The permissions are drwxrwxr-x. I'm not sure what the numerical equivalent is. – Swift Dev Journal May 23 '19 at 18:08
  • @MarkSzymczyk okay. Then that isn't the issue. The only other things I've seen are installing erlang-parsetools and erlang-dev. How did you install Erlang? – philosodad May 23 '19 at 18:35
  • @philosodad It's been a year since I asked this question so I'm not exactly sure how I installed Erlang. I either installed it using Homebrew or from source from the Erlang site. – Swift Dev Journal May 23 '19 at 19:50
  • @MarkSzymczyk if with homebrew I'd try updating/upgrading Erlang. I haven't been able to reproduce this error with any version of Erlang I have installed without messing around with the ~/.config file so I'm at a bit of a loss. I know it's been a while since you asked but I hate to think that you can't even mess around with Phoenix because it won't install! – philosodad May 23 '19 at 22:15
  • @philosodad I updated the question with my latest attempt using Erlang 22 and Phoenix 1.4.6. I appreciate the help, but I still get the same error running mix.ecto.create. – Swift Dev Journal May 24 '19 at 03:50