Skip to content

Instantly share code, notes, and snippets.

@olepalm
Last active July 9, 2024 07:21
Show Gist options
  • Save olepalm/ca31a9678f9a15c023e5d6f3ea9167c4 to your computer and use it in GitHub Desktop.
Save olepalm/ca31a9678f9a15c023e5d6f3ea9167c4 to your computer and use it in GitHub Desktop.
Installing mysql2 gem on macports: ld: library not found for -lzstd
Modify the mysql build options to use a `lzstd` library
Step one:
Make a symlink of lzstd in the macports default install library
`ln -fs /opt/local/lib/zstd /usr/local/lib/lzstd`
Step two:
Allow install of mysql2 to use the symlinked lzstd version (and also quiet any implicit function declaration warnings to get cleaner output)
`bundle config build.mysql2 --with-mysql-config=/opt/local/lib/mysql8/bin/mysql_config --with-cflags="-Wno-error=implicit-function-declaration" --with-opt-dir="/opt/local" --with-opt-include="/opt/local/lib/lzstd"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment