Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ex_cldr is not compiling with Elixir 1.7.2 #494

Open
glafontant opened this issue Oct 14, 2020 · 1 comment
Open

ex_cldr is not compiling with Elixir 1.7.2 #494

glafontant opened this issue Oct 14, 2020 · 1 comment

Comments

@glafontant
Copy link

I ran mix deps.get per the installation docs. I opted to go with the manual process rather than Docker. The only hex package not to compile for the phoenix app is ex_cldr. I received the following compilation error

could not compile dependency :ex_cldr, "mix compile" failed. You can recompile this dependency with "mix deps.compile ex_cldr", update it with "mix deps.update ex_cldr" or clean it with "mix deps.clean ex_cldr"

Here is output from mix hex.info

Hex:    0.20.5
Elixir: 1.7.2
OTP:    22.0.7

Researching this error it appear to occur when a machine has 2 different versions of Elixir installed. I have two versions of Elixir as I have 1.9.1 as my default and 1.7.2 for this application. To resolve this error I ran the following commands.

mix clean; mix deps.clean --all; rm -rf _build

Ran mix deps.get and did not see the error. Unfortunately when I tried to create the DB by running mix ecto.create. The same compilation error returned. Has any seen this error or any tips how to manage hex dependancies with 2 versions of Elixir? Is there a version of RVM or RBENV for Elixir? Thank you.

@ddezoysa
Copy link

Hi,

I'm also getting the same issue in mix ecto.create.

Generated ex_cldr app
==> ex_cldr_currencies
Compiling 1 file (.ex)
warning: undefined module attribute @struct, please remove access to @struct or explicitly set it before access
  lib/cldr_currency.ex:94: Cldr.Currency (module)

warning: undefined module attribute @struct, please remove access to @struct or explicitly set it before access
  lib/cldr_currency.ex:343: Cldr.Currency (module)


== Compilation error in file lib/cldr_currency.ex ==
** (UndefinedFunctionError) function nil.__struct__/0 is undefined. If you are using the dot syntax, such as map.field or module.function(), make sure the left side of the dot is an atom or a map
    nil.__struct__()
    (elixir 1.12.2) lib/kernel.ex:2303: Kernel.struct/3
    lib/cldr_currency.ex:343: anonymous fn/1 in :elixir_compiler_2.__MODULE__/1
    (elixir 1.12.2) lib/enum.ex:1586: anonymous fn/3 in Enum.map/2
    (stdlib 3.15.2) maps.erl:410: :maps.fold_1/3
    (elixir 1.12.2) lib/enum.ex:2397: Enum.map/2
    lib/cldr_currency.ex:343: anonymous fn/2 in :elixir_compiler_2.__MODULE__/1
    (elixir 1.12.2) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3
could not compile dependency :ex_cldr_currencies, "mix compile" failed. You can recompile this dependency with "mix deps.compile ex_cldr_currencies", update it with "mix deps.update ex_cldr_currencies" or clean it with "mix deps.clean ex_cldr_currencies"

@glafontant Did you manage to get this issue resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants