运行Crystal Play时出错

时间:2016-03-29 05:48:52

标签: crystal-lang

我已经安装了check and libevent,安装了GCC。 LLVM已更新。运行Crystal Play工作,然后崩溃,出现以下错误。我可以看到localhost输出。但它会尝试运行代码,然后崩溃。

    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`

1 个答案:

答案 0 :(得分:3)

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

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

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