我刚刚更新并重新加载了rvm,rvm安装了2.4.0,当我运行gem时,我得到:
➜ ~ gem install irbtools
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
➜我在谷歌上搜索了一下,找到了几个所谓的解决方案,但除了建议使用不安全的gem URL之外,没有一个可行的方案,这是我不想做的。
顺便说一句,openssl是安装的,但不是由brew安装的:
➜ ruby-2.4.0 brew install openssl
Warning: openssl is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version我怎样才能让gem与一个安全的gem源一起工作?
发布于 2017-02-17 23:34:19
解决方案是安装brew的OpenSSL:
brew install --force openssl
(我收到一条奇怪的消息,说`--force被忽略了,但它确实安装正常。)
然后,执行brew info openssl和RTFM!:)根据它告诉我的内容,我将这个添加到我的~/.zshc文件中:
# For Ruby 2.4 to find brew's OpenSSL: export LDFLAGS=-L/usr/local/opt/openssl/lib export CPPFLAGS=-I/usr/local/opt/openssl/include export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
然后,我打开了一个新的终端窗口并重新安装了Ruby 2.4:
rvm reinstall 2.4
在那之后,gem开始工作了。
https://stackoverflow.com/questions/42301756
复制相似问题