Problem with mix ecto.create for a new Phoenix project on WSL2 Ubuntu 20.04

Using:

* Windows 11
* WSL2
* Ubuntu 20.04

I installed BEAM and Elixir with apt:

* Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]
* Elixir 1.13.4 (compiled with Erlang/OTP 25)

I installed hex per the Phoenix guide (output is a re-run for this post):

$ mix local.hex
Found existing entry: /home/dev/.mix/archives/hex-1.0.1
Are you sure you want to replace it with "https://repo.hex.pm/installs/1.13.0/hex-1.0.1.ez"? [Yn]
* creating /home/dev/.mix/archives/hex-1.0.1

I installed latest Phoenix per guide:

$ mix archive.install hex phx_new
Resolving Hex dependencies...
Dependency resolution completed:
New:
  phx_new 1.6.11
* Getting phx_new (Hex package)
All dependencies are up to date
Compiling 11 files (.ex)
Generated phx_new app
Generated archive "phx_new-1.6.11.ez" with MIX_ENV=prod
Found existing entry: /home/dev/.mix/archives/phx_new-1.6.11
Are you sure you want to replace it with "phx_new-1.6.11.ez"? [Yn]
* creating /home/dev/.mix/archives/phx_new-1.6.11

I create a new Phoenix app:

$ mix phx.new hello
...
* creating hello/priv/static/images/phoenix.png
* creating hello/priv/static/favicon.ico

Fetch and install dependencies? [Yn]
* running mix deps.get
* running mix deps.compile

I cd into app then try to create db:

$ cd hello/
$ mix ecto.create
sh: 1: Syntax error: "(" unexpected
** (Mix) Could not compile dependency :telemetry, "/home/dev/.mix/rebar3 bare compile --paths /home/dev/projects(U2204)/github/waialualib/hello/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile telemetry", update it with "mix deps.update telemetry" or clean it with "mix deps.clean telemetry"
$

Any ideas?

1 Like

Looks like the same issue as discussed in this thread:

1 Like

Your project directory path contains β€œ(” and β€œ)” in absolute path, you can rename or remove the β€œβ€¦/projects(U2204)/” to something like β€œprojects_2204”

3 Likes

Thank you for the helpful responses. Apologies for not checking the other thread. And, wow, totally missed the ()'s in the console error message. Pretty obvious in hindsight!