简体   繁体   English

在Windows上安装Puma错误

[英]Installing Puma on Windows error

Tried installing Puma on Windows and getting this error - 尝试在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

Tried several solutions to try and fix the problem, but they all somehow end up with this error. 尝试了几种解决方案来尝试解决此问题,但是最终都以该错误告终。

I have Openssl installed on my computer and have used it to do some SSL certificate stuff, so I'm definitely sure it's installed properly. 我在计算机上安装了Openssl,并用它来做一些SSL证书工作,因此,我肯定可以正确安装它。

Anyone able to help? 有人能帮忙吗?

To give you a summary of things you need to do: 为了给您摘要您需要做的事情:

Download OpenSSL package for x64-windows (since you're using x64 version of Ruby): http://packages.openknapsack.org/openssl/openssl-1.0.0k-x64-windows.tar.lzma Extract the package, as indicated in several RubyInstaller posts Proceed again with gem installation and point to the directory where you extracted OpenSSL 下载适用于x64-windows的OpenSSL软件包(因为您使用的是x64版本的Ruby): http : //packages.openknapsack.org/openssl/openssl-1.0.0k-x64-windows.tar.lzma按照说明解压缩该软件包在RubyInstaller的几篇文章中,再次进行gem安装并指向您提取OpenSSL的目录

The commands will be something like this: 这些命令将是这样的:

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

This worked for me (with x86 version), following these steps: 1.To install OpenSSL, I went here: https://www.tbs-certificates.co.uk/FAQ/en/openssl-windows.html . 请按照以下步骤为我工作(使用x86版本):1.要安装OpenSSL,我去了: https : //www.tbs-certificates.co.uk/FAQ/en/openssl-windows.html 2. Running windows cmd as administrator, I created the directory C:/OpenSSL-Win32. 2.以管理员身份运行Windows cmd,创建目录C:/ OpenSSL-Win32。 3. Following the instructions from step 1, I went to https://www.openssl.org/source/ and downloaded the opensslpackage for x86 (openssl-1.0.1p-tar-gz) and extracted it via 7-Zip to C:/OpenSSL-Win32 4. Still as admin, ran C:>gem install puma --platform=ruby -- --with-opt-dir=C:/OpenSSL-Win32. 3.按照步骤1的说明进行操作,我转到https://www.openssl.org/source/ ,下载了x86的openssl软件包(openssl-1.0.1p-tar-gz),并通过7-Zip将其提取到C :/ OpenSSL-Win32 4.仍然以管理员身份运行C:> gem install puma --platform = ruby​​---with-opt-dir = C:/ OpenSSL-Win32。 Note: I was following the Hartl tutorial, and had specified gem 'puma', '2.11.1'. 注意:我遵循了Hartl教程,并指定了gem'puma','2.11.1'。 However, this method resulted in '2.14.0' being installed. 但是,此方法导致安装了“ 2.14.0”。

@Rajarshi Das, thanks! @Rajarshi Das,谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM