zac

zac

I’m new to Ash and going through tutorials. In the AshPhoenix walkthrough, after the basic setup I’m getting the following error trying to create the database:

z@Serenity my_ash_phoenix_app % mix ash_postgres.create
** (Mix) Could not load MyAshPhoenixApp.Blog, error: :nofile.

There’s no other info to go on. The referenced walkthrough is: Get Started with Ash and Phoenix — ash_phoenix v2.3.23

Wondering if anyone has run into this error and knows what could cause it? I’ve checked the obvious. MyAskPhoenixApp.Blog is declared in my_ash_phoenix_app/blog/blog.ex:

defmodule MyAshPhoenixApp.Blog do
  use Ash.Api

  resources do
    registry MyAshPhoenixApp.Blog.Registry
  end
end

Confirmed that the right deps are included, etc… any help would be appreciated.

Using Elixir 1.15.7 / OTP 26, and these deps:

      {:ash, "~> 2.16.1"},
      {:ash_postgres, "~> 1.3.6"},
      {:ash_phoenix, "~> 1.1"}

Showing Posts 1 to 7

jimsynz

jimsynz

Ash Core Team

Hi @zac :wave:

Sorry for the slow reply.

Can you show me the contents of your config/config.exs?

zac

zac OP

You bet! Hoping there are no embarrassing typos. :slight_smile: It’s the generated config, plus the two lines at the top from the AshPhoenix walkthrough docs. Here you go:

# This file is responsible for configuring your application
# and its dependencies with the aid of the Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.

# General application configuration
import Config

config :my_ash_phoenix_app,
  ash_apis: [MyAshPhoenixApp.Blog]

config :my_ash_phoenix_app,
  ecto_repos: [MyAshPhoenixApp.Repo],
  generators: [timestamp_type: :utc_datetime]

# Configures the endpoint
config :my_ash_phoenix_app, MyAshPhoenixAppWeb.Endpoint,
  url: [host: "localhost"],
  adapter: Phoenix.Endpoint.Cowboy2Adapter,
  render_errors: [
    formats: [html: MyAshPhoenixAppWeb.ErrorHTML, json: MyAshPhoenixAppWeb.ErrorJSON],
    layout: false
  ],
  pubsub_server: MyAshPhoenixApp.PubSub,
  live_view: [signing_salt: "cKy/s3Gh"]

# Configures the mailer
#
# By default it uses the "Local" adapter which stores the emails
# locally. You can see the emails in your browser, at "/dev/mailbox".
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
config :my_ash_phoenix_app, MyAshPhoenixApp.Mailer, adapter: Swoosh.Adapters.Local

# Configure esbuild (the version is required)
config :esbuild,
  version: "0.17.11",
  default: [
    args:
      ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
    cd: Path.expand("../assets", __DIR__),
    env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
  ]

# Configure tailwind (the version is required)
config :tailwind,
  version: "3.3.2",
  default: [
    args: ~w(
      --config=tailwind.config.js
      --input=css/app.css
      --output=../priv/static/assets/app.css
    ),
    cd: Path.expand("../assets", __DIR__)
  ]

# Configures Elixir's Logger
config :logger, :console,
  format: "$time $metadata[$level] $message\n",
  metadata: [:request_id]

# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"
jimsynz

jimsynz

Ash Core Team

Huh. Seems fine. This may seem like an oddball question but what is the file path of the MyAshPhoenixApp.Blog module?

zac

zac OP

No spaces or any other weirdness…

zac@Serenity blog % pwd
/Users/zac/Projects/Elixir/ash/my_ash_phoenix_app/blog
zac@Serenity blog % ls
./           ../          blog.ex      registry.ex  resources/
zac@Serenity blog % cat blog.ex
defmodule MyAshPhoenixApp.Blog do
  use Ash.Api

  resources do
    registry MyAshPhoenixApp.Blog.Registry
  end
end
jimsynz

jimsynz

Ash Core Team

right. the file needs to be in the lib directory of the project or Mix won’t compile it.

zac

zac OP

oh fer gawd sakes. Thanks. Sometimes it just takes another pair of eyes. :confused:

THANK YOU.

jimsynz

jimsynz

Ash Core Team

All good. **** happens.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews