Ruby ruby2.0.0 源码安装时关于 openssl 的问题

whzlong · 2013年09月21日 · 最后由 whzlong 回复于 2013年12月16日 · 4449 次阅读

使用平台:Mac OS X 10.8.5

用源码编译安装完 ruby2.0.0 后,准备利用 gem 安装 rails,但是出现下面的错误: ERROR: Loading command: install (LoadError) cannot load such file --openssl ERROR: While executing gem ... (NoMethodError) undefined method 'invoke_with_build_args' for nil : NilClass

从错误提示信息上看,应该是没有安装 openssl,接着打算利用源码安装 openssl, 将目录定位到源码中 openssl 所在的目录 ruby2.0.0-p247/ext/openssl. 执行下面的命令安装 openssl: ruby extconf.rb 结果出现下面的错误: checking for SSL_library_init() in openssl/ssl.h with -Werror=deprecated-declarations... no extconf.rb:62:in '': Ignore OpenSSL broken by Apple. (RuntimeError) Please use another openssl.(e.g. using 'configure --with-openssl-dir=/path/to/openssl') 后来打算利用./configure 加上参数--with-openssl-dir 重新编译安装 ruby2.0,结果发现--with-openssl-dir 好像不是./configure 的参数选项。 有很多人建议用 RVM 来安装 ruby,但是如果仅仅是通过上述方式安装 ruby2.0,有没有什么好的解决方案呢?

keywords: homebrew openssl

#2 楼 @song940 多谢解答,还是有个问题,最后用编译 ruby 源码时还是有问题 , --with-openssl-dir 并不是./configure 的选项,难道需要自定义一个这样的选项么

需要 登录 后方可回复, 如果你还没有账号请 注册新账号