0

I'm trying to run an elixir project, but when i try to install the dependencies with mix deps.get, i get this error:

** (File.Error) could not read file "/mnt/c/Users/user/Desktop/project/config/dev\r.exs": no such file or directory
    (elixir 1.12.3) lib/file.ex:355: File.read!/1
    (elixir 1.12.3) lib/config.ex:243: Config.__import__!/1
    (mix 1.12.3) lib/mix/config.ex:161: anonymous fn/2 in Mix.Config.__import__!/2
    (elixir 1.12.3) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.12.3) lib/mix/config.ex:160: Mix.Config.__import__!/2
    (stdlib 3.16.1) erl_eval.erl:685: :erl_eval.do_apply/6

Actually I have the dev.exs file in the config folder, but i don't understand what this "\r" at the end of the file name at the error means.

i'm working with windows subsystem for linux, to use asdf to manage versions, the current ones are these:

Erlang/OTP 24 [erts-12.1.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]

Elixir 1.12.3 (compiled with Erlang/OTP 24)

Hope somebody can help me with this situation. Thanks a lot.

OliOli
  • 9
  • 3
  • 1
    `\r` is a carriage return. It looks like whatever is setting the `dev` value is also including a carriage return at the end. It could be because of your config, or it could be related to differences between Linux and Windows newline sequences. Also FWIW `Mix.Config` is deprecated, use [Config](https://hexdocs.pm/elixir/Config.html) instead. – Adam Millerchip Oct 04 '21 at 07:30

1 Answers1

0

Looks like you've got a stray carriage return somewhere. Possibly in a string.

For example, on OSX, in iex I can generate a string like this by hitting return before adding the closing quote:

iex(1)> string = "dev
"
"dev\n"

I suggest you check your config for incorrect quoting, probably near the code that loads the environment specific config file (Typically something like import_config "#{config_env()}.exs" in config.exs.

Stratus3D
  • 4,648
  • 4
  • 35
  • 67