ruby-on-rails – 在Windows上安装Puma错误

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 在Windows上安装Puma错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
尝试在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证书的东西,所以我肯定确定它已正确安装.

有人能帮忙吗?

解决方法

为了总结您需要做的事情:

下载适用于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
原文链接:https://www.f2er.com/ruby/274263.html

猜你在找的Ruby相关文章