当我尝试运行像 ruby script/server 这样的应用程序服务器时
它说/usr/lib/ruby/1.8/openssl/cipher.rb:22: Cipher is not a module (TypeError)
。
所以我按照以下链接。
当我运行以下命令时:
ruby extconf.rb
我遇到了以下错误:
=== OpenSSL for Ruby configurator
===
=== Checking for system dependent stuff...
=== checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for assert.h... yes
=== Checking for required stuff...
=== checking for openssl/ssl.h... no
=== Checking for required stuff failed.
=== Makefile wasn't created. Fix the errors above. * extconf.rb failed *
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-kerberos-dir
--without-kerberos-dir
--with-kerberos-include
--without-kerberos-include=${kerberos-dir}/include
--with-kerberos-lib
--without-kerberos-lib=${kerberos-dir}/lib
--with-debug
--without-debug
--enable-debug
--disable-debug
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
答案1
似乎 extconf 无法检测到 openssl 开发标头/库。您应该安装它或帮助 extconf 找到它(如果已安装 openssl 开发文件):
ruby extconf.rb --with-openssl-dir="prefix-on-file-system-where-openssl-files-resides"
ruby extconf.rb --with-openssl-include="include-files-location" \
--with-oppenssl-lib="openssl-libs-location"