运行 Crystal 播放时出错

Errors when running Crystal Play

我已检查并安装了 libevent,安装了 GCC。 LLVM 已更新。 运行 Crystal 播放正常,然后因以下错误而崩溃。我可以看到本地主机输出。但它会尝试 运行 代码然后它会崩溃。

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.2.0

  CPUs-MacBook-Air:~ cpu$ crystal play
Listening on http://localhost:8080
ld: library not found for -levent
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc -o "/Users/cpu/Documents/homebrew/.crystal/crystal-run-play-1-1.tmp" "${@}"  -rdynamic  -lssl -lcrypto -lz /usr/local/Cellar/crystal-lang/0.14.2/src/ext/libcrystal.a -levent -lpcre -liconv -lgc -lpthread -ldl`

查看 OSX 安装页面:http://crystal-lang.org/docs/installation/on_mac_osx_using_homebrew.html

您可能需要为 xcode 执行这些操作才能找到 libevent:

$ xcode-select --install
$ xcode-select --switch /Library/Developer/CommandLineTools