Skip to content

Fix FunctionClauseError on Code.ensure_compiled on Ecto 1.1#7

Open
deraru wants to merge 2 commits intoseaneshbaugh:masterfrom
deraru:feature/fix-argument-for-ensure-repo-on-ecto-1-1
Open

Fix FunctionClauseError on Code.ensure_compiled on Ecto 1.1#7
deraru wants to merge 2 commits intoseaneshbaugh:masterfrom
deraru:feature/fix-argument-for-ensure-repo-on-ecto-1-1

Conversation

@deraru
Copy link

@deraru deraru commented Oct 15, 2017

Hello,

I found an following error.

** (FunctionClauseError) no function clause matching in Code.ensure_compiled/1    
    
    The following arguments were given to Code.ensure_compiled/1:
    
        # 1
        [MyApp.Repo]
    
    (elixir) lib/code.ex:575: Code.ensure_compiled/1
    lib/mix/ecto.ex:64: Mix.Ecto.ensure_repo/2
    lib/mix/tasks/exseed.seed.ex:23: Mix.Tasks.Exseed.Seed.run/1
    (mix) lib/mix/task.ex:301: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:75: Mix.CLI.run_task/2
    (elixir) lib/code.ex:376: Code.require_file/2

Environments:

  • ecto 2.1.5
  • exseed 0.0.4

I debugged this error and found a cause.
In Ecto 1.0.0, Ecto.parse_repo returns simply Repo.
Ref. https://github.com/elixir-ecto/ecto/blob/v1.0/test/mix/ecto_test.exs#L5

But after Ecto 1.1.0, Ecto.parse_repo returns [Repo].
Ref. https://github.com/elixir-ecto/ecto/blob/v1.1/test/mix/ecto_test.exs#L5

I fixed this error by using iterator.
Could you merge this?

Thanks,

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

Successfully merging this pull request may close these issues.

1 participant