尝试在Windows上安装Puma并收到此错误 -
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-dir=c:\openssl'
This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb --with-opt-dir=c:\openssl
checking for BIO_read() in -lcrypto... no
checking for BIO_read() in -llibeay32... no
*** 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
--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=C:/RailsInstaller/Ruby2.1.0/bin/ruby
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-cryptolib
--without-cryptolib
--with-libeay32lib
--without-libeay32lib
extconf failed, exit code 1
Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1
.0/gems/puma-2.11.2 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86
-mingw32/2.1.0/puma-2.11.2/gem_make.out
尝试了几种解决方案来尝试修复问题,但它们都以某种方式结束了这个错误。
我的计算机上安装了Openssl,并使用它来做一些SSL证书,所以我确定它已经正确安装。
任何人都可以提供帮助吗?
答案 0 :(得分:7)
为您提供您需要做的事情摘要:
下载适用于x64-windows的OpenSSL软件包(因为您使用的是x64版本的Ruby):http://packages.openknapsack.org/openssl/openssl-1.0.0k-x64-windows.tar.lzma 解压缩包,如几个RubyInstaller帖子中所示 继续使用gem安装并指向您解压缩OpenSSL的目录
命令将是这样的:
C:\>mkdir C:\MyDir\x64-windows
C:\>cd C:\MyDir\x64-windows
C:\MyDir\x64-windows>bsdtar --lzma -xf openssl-1.0.0k-x64-windows.tar.lzma
C:\>gem install puma --platform=ruby -- --with-opt-dir=C:/MyDir/x64-windows
答案 1 :(得分:1)
这适用于我(使用x86版本),遵循以下步骤: 1.为了安装OpenSSL,我来到了这里:https://www.tbs-certificates.co.uk/FAQ/en/openssl-windows.html。 2.以管理员身份运行windows cmd,我创建了目录C:/ OpenSSL-Win32。 3.按照步骤1的说明,我转到https://www.openssl.org/source/并下载了opensslpackage for x86(openssl-1.0.1p-tar-gz)并通过7-Zip将其解压缩到C:/ OpenSSL-Win32 4.仍作为管理员,运行C:> gem install puma --platform = ruby - --with-opt-dir = C:/ OpenSSL-Win32。 注意:我正在关注Hartl教程,并指定了gem'puma','2.11.1'。但是,这种方法导致安装了“2.14.0”。
@Rajarshi Das,谢谢!