Comments (4)
Update:
The solution for this is to move the factory.ex
file from lib/my_app/factory.ex
to test/support/factory.ex
.
I see now that the README says to do this now.
I was confused because I was following constable.
We can leave this closed, just posting for future generations.
from ex_machina.
Hi @lpender, thanks for opening this issue. I am unable to reproduce the error the way you've defined it. Could you provide some more information on how to reproduce it? What does your factory.ex
module look like?
from ex_machina.
@lpender I'm gonna close this issue since I imagine you got it resolved. But if I'm mistaken, please feel free to comment here and we can reopen it.
from ex_machina.
Hi,
Thanks,
I'm using the Dockerfile described in the Phoenix Documentation.
Notably, because Mix
is a build tool, many things fail with this setup, i.e. any calls to Mix.env()
in runtime code (which I see for example, in the default router.ex
generated by Phoenix and in constable).
This is puzzling to me, but I digress.
I'm still running into this issue.
# mix.exs
defp deps do
{:ex_machina, "~> 2.4", only: :test}
end
# lib/risc/factory.ex
defmodule Risc.Factory do
use ExMachina.Ecto, repo: Risc.Repo
def account_factory do
%Risc.Accounts.Account{
email: sequence(:email, &"email-#{&1}@example.com"),
password: "sooperdoopersecret"
}
end
end
Docker Compilation:
Step 17/25 : RUN mix do compile, release
---> Running in c6748e8c0dd3
Compiling 34 files (.ex)
== Compilation error in file lib/risc/factory.ex ==
** (CompileError) lib/risc/factory.ex:2: module ExMachina.Ecto is not loaded and could not be found
(elixir) expanding macro: Kernel.use/2
lib/risc/factory.ex:2: Risc.Factory (module)
This error doesn't happen if I remove the only: :test
but that causes the mix compile,release
command to fail with a different error:
Cannot read "/app/_build/prod/rel/my_app/releases/0.1.0/start.script
from ex_machina.
Related Issues (20)
- def build/2 defines defaults multiple times HOT 2
- Use of `build( ... )` with Ecto 3.4+ leads to many association preload warnings HOT 7
- Compiler warning when using an a project using Elixir 1.11 HOT 3
- Insert with assocs fails constraint HOT 1
- Proposal: Introduce build_lazy/2 HOT 3
- Cast polymorphic embeds HOT 10
- Inserted data breaks manual test HOT 3
- Allow sequence in attributes passed to `insert_list` HOT 5
- Hundreds of depreciation compiler warnings when running tests HOT 4
- insert/2 doesn't work with compound primary keys HOT 3
- Allow sequences indices to be persisted between runs HOT 2
- sequence starting with 0
- Is this project maintained? HOT 17
- Sequence reset doesn't respect the `start_at` option
- sequence(:example_id, & &1) put chars instead of integer HOT 3
- Stringify `Ecto.Enum` values when using `string_params`/`string_params_with_assocs`
- Option to have `insert_list` leverage Ecto's `insert_all`
- an intermittent error on async false tests HOT 1
- nvim diagnostics error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ex_machina.