在Debian上安装mysql2 gem时,Ruby on Rails找不到-lssl和-lcrypto

时间:2017-11-07 14:06:48

标签: ruby-on-rails ruby debian mariadb libssl

我现在正尝试将Ruby上的ruby与MariaDB连接起来。但由于某些原因,在尝试安装mysql2 gem时,我收到此错误:

/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto

我在轨道上的ruby缺少什么SSL / Crypto库?

我无法找到有这个确切问题的其他人。

我得到的错误:

"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -
I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -
I/usr/include/mysql -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -fdebug-prefix-
map=/build/ruby2.3-yge53O/rub$
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -
I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -
I/usr/include/mysql -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -fdebug-prefix-map=/build/ruby2.3-yge53O/rub$
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */

1 个答案:

答案 0 :(得分:2)

看起来你错过了libssl-dev包。尝试运行:

sudo apt-get update
sudo apt-get install libssl-dev

安装软件包后,再次尝试安装gem。