DEV Community

Shintaro Kaneko
Shintaro Kaneko

Posted on

Troubleshooting `ld: library not found for -lssl'

Trouble

linking shared-object mysql2/mysql2.bundle                                                              
ld: library not found for -lssl                                                                         
clang: error: linker command failed with exit code 1 (use -v to see invocation)                                             
make: *** [mysql2.bundle] Error 1                                                                       

make failed, exit code 2                            

I got the error during executing gem install mysql2. It seems that the linkable library path is not configured correctly on Mojave.

Shooting

Invoking the command with LIBRARY_PATH to be able to find out the openssl library explicitly.

$ LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib gem install mysql2

That's all. 😎

Top comments (0)