【发布时间】:2017-02-26 21:40:26
【问题描述】:
正在尝试安装特定版本的 Mysql2 Gem。我明白了:
sudo gem install mysql2 -v '0.3.20'
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/local/var/rbenv/versions/2.2.3/bin/ruby -r ./siteconf20161017-56699-1dsu6v9.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /usr/local/Cellar/mysql/5.7.16/lib
-----
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
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
作为参考,我事先运行了brew install mysql,它运行成功。我还尝试卸载所有版本的brew 的mysql 引用以防万一。
我有什么遗漏吗?我环顾四周,大多数页面都指向确保您运行 brew install mysql,我有。
如果我对上述解释不太清楚,我遇到的失败是在成功运行brew install mysql 之后,错误是因为之后尝试通过gem install mysql2 -v '0.3.20' 安装 gem
有什么想法吗? 谢谢
【问题讨论】:
-
@msmith 让我们知道上述 ref 对您的影响
-
这和我做的一样,我用brew成功安装了它,但是之后我实际上无法成功安装gem IE
gem install mysql -v '0.3.20'