【问题标题】:Installing Puma on Windows error在 Windows 上安装 Puma 错误
【发布时间】:2015-07-24 03:33:26
【问题描述】:

尝试在 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 证书的事情,所以我确信它安装正确。

谁能帮忙?

【问题讨论】:

  • 我已经下载并打开它并使用它来生成 SSL 密钥。

标签: ruby-on-rails ruby-on-rails-4 ssl puma


【解决方案1】:

总结一下你需要做的事情:

下载适用于 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

【讨论】:

  • 已完成所有这些步骤,但仍无法正常工作。得到完全相同的错误。
【解决方案2】:

这对我有用(使用 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/ 并下载了适用于 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。 注意:我正在关注 Hartl 教程,并指定了 gem 'puma'、'2.11.1'。但是,这种方法导致安装了“2.14.0”。

@Rajarshi Das,谢谢!

【讨论】:

  • 我不确定将我的项目同步到其他 Linux 和 Mac 电脑是否有问题。我已将它们更改为使用“214.0”...
猜你喜欢
  • 2015-11-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-29
  • 2015-03-24
  • 2019-03-01
  • 1970-01-01
  • 2014-10-05
  • 2017-04-14
相关资源
最近更新 更多