运行mix phx.server时找不到可执行文件`mac_listener`

时间:2019-04-11 05:47:06

标签: macos elixir macos-mojave

尽管Mac监听器已安装,但在Macos Mojave上找不到它。 我试图重新编译依赖关系并重新安装模块,但是问题仍然存在。

mix deps.compile file_system返回此错误。

mix deps.compile file_system

14:34:40.227 [info]  Compiling file system watcher for Mac...
==> file_system
c_src/mac/cli.c:1:10: fatal error: 'getopt.h' file not found
#include <getopt.h>
         ^~~~~~~~~~
1 error generated.

14:34:40.469 [error] Could not compile file system watcher for Mac, try to run "clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o priv/mac_listener" manually inside the dependnecy.

1 个答案:

答案 0 :(得分:1)

最后的解决方法是这个。

第一

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

然后

mix do deps.get, deps.compile