새 맥북을 셋업하는 중, mysql2
젬을 설치하려고 할 때 다음과 같은 에러가 뜨면서 문제가 생겼다.
Installing mysql2 0.5.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
ld: library not found for -lzstd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1
zstd
도 잘 깔려있었는데 안 되어서 어떤 문제인지 찾아보니 라이브러리 패스를 찾지 못해서 생기는 문제로 보인다. 다음과 같이 해결할 수 있다.
export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/
bundle install