简体   繁体   中英

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.

该问题可以通过用Application.app_path(app_name,“ priv / posts”)替换“ priv / posts”来解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM