ruby运行出错3--centos7编译ruby2.3.0出错

编译安装了ruby2.3.0。 然后安装gem时, 会有错误提示:


ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

 

重新编译发现, make的输出中有


configuring openssl
Failed to configure openssl. It will not be installed.

如上字样。

 

然后重新配置, 在运行configure时加上了openssl路径信息即可。 正确编译的姿势如下:

$ cd ruby-2.3.0
$ ./configure  --with-openssl-dir=/usr/local/ssl
$ make
$ sudo make install

再次安装gem,无报错信息。 编译成功。

猜你喜欢

转载自angelguo.iteye.com/blog/2282589