我的系统是centos 7.5,已离线安装ruby-2.3.0,openssl-1.0.2l,rubygems-2.7.4 如下图:
但是在 gem sources -a http://gems.ruby-china.org/ 时报错 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 /app/ruby-2.3.0
# ./configure --with-openssl-dir=/app/openssl-1.0.2l/ssl
# make
# sudo make install
再次执行 gem sources -a http://gems.ruby-china.org/ ,虽然上面的错没有了,又报错
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::RemoteFetcher::Zlib
原文地址:https://www.cnblogs.com/a-du/p/8125089.html
时间: 2024-10-29 03:05:26