Crystal: Can not install crystal at macos through brew install

Created on 19 Sep 2020  路  5Comments  路  Source: crystal-lang/crystal

when I ran brew install crystal , I got the following error:
```bash
make
crystal
release=true
FLAGS=--no-debug
CRYSTAL_CONFIG_LIBRARY_PATH=

Using /usr/local/opt/llvm/bin/llvm-config [version=10.0.1]
CRYSTAL_CONFIG_LIBRARY_PATH="" CRYSTAL_CONFIG_BUILD_COMMIT="" SOURCE_DATE_EPOCH="1592582883" ./bin/crystal build --no-debug --release -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
ld: library not found for -llibxml2.tbd (this usually means you need to install the development package for liblibxml2.tbd)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: clang "${@}" -o '/private/tmp/crystal-20200919-29356-18f2s4n/crystal-0.35.1/.build/crystal' -rdynamic /private/tmp/crystal-20200919-29356-18f2s4n/crystal-0.35.1/src/llvm/ext/llvm_ext.o"/usr/local/opt/llvm/bin/llvm-config" --libs --system-libs --ldflags 2> /dev/null-lstdc++ -lpcre -lgc -lpthread /private/tmp/crystal-20200919-29356-18f2s4n/crystal-0.35.1/src/ext/libcrystal.a -levent -liconv -ldl -L/private/tmp/crystal-20200919-29356-18f2s4n/crystal-0.35.1/boot/embedded/lib -L/private/tmp/crystal-20200919-29356-18f2s4n/crystal-0.35.1/boot/embedded/lib
make: * [.build/crystal] Error 1
`

Most helpful comment

Ref: https://github.com/Homebrew/homebrew-core/pull/61005

As a temporal workaround you can either:

A. install llvm from 6616d50fb0b24dbe30f5e975210bdad63257f517 brew version you will have 10.0.0 which works.

B. Use the darwin .tar.gz from github releases.

All 5 comments

Looks like you're missing libxml2. What happens if you do like:

brew install libxml2
brew install crystal

Ref: https://github.com/Homebrew/homebrew-core/pull/61005

As a temporal workaround you can either:

A. install llvm from 6616d50fb0b24dbe30f5e975210bdad63257f517 brew version you will have 10.0.0 which works.

B. Use the darwin .tar.gz from github releases.

Looks like you're missing libxml2. What happens if you do like:

brew install libxml2
brew install crystal

had libxml2 installed, still the same

Ref: Homebrew/homebrew-core#61005

As a temporal workaround you can either:

A. install llvm from 6616d50fb0b24dbe30f5e975210bdad63257f517 brew version you will have 10.0.0 which works.

B. Use the darwin .tar.gz from github releases.

You're right, I tried brew reinstall --build-from-source Formula/llvm and try brew install crystal, It worked, thanks very much, you really saved my day.

Was this page helpful?
0 / 5 - 0 ratings