Zarko Cekovski
Zarko Cekovski

Reputation: 31

Could not read "priv/post": no such file or directory

I've been trying to build an blog using Phoenix, and deploy it with exrm. Everything works error-free in development, but the exrm release gives me errors when I try to open it in a console. I've been following this tutorial.

This is the error message I get in iex:

[info] Application blog exited: Blog.start(:normal, []) returned an error: shutdown: failed to start child: Blog.Repo
    ** (EXIT) an exception was raised:
        ** (File.Error) could not list directory "priv/posts": no such file or directory
            (elixir) lib/file.ex:1174: File.ls!/1
            (blog) lib/blog/crawler.ex:3: Blog.Crawler.crawl/0
            (elixir) lib/agent/server.ex:8: Agent.Server.init/1
            (stdlib) gen_server.erl:328: :gen_server.init_it/6
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Just to be clear the directory "priv/posts" does exist in my project. And mix phoenix.server does recognize it. It's only showing the error in the exrm release.

Upvotes: 0

Views: 916

Answers (1)

Zarko Cekovski
Zarko Cekovski

Reputation: 31

The problem can be solved by replacing "priv/posts" with Application.app_path(app_name, "priv/posts").

Upvotes: 2

Related Questions