【发布时间】:2013-12-16 03:33:43
【问题描述】:
我正在尝试安装 puma gem,但是当我运行时
gem install puma
我收到此错误消息:
Temporarily enhancing PATH to include DevKit
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
make
generating puma_http11-i386-mingw32.def
compiling http11_parser.c
ext/http11/http11_parser.rl: In function 'puma_parser_execute':
ext/http11/http11_parser.rl:111:3: warning: comparison between signed and unsigned integer expressions
compiling io_buffer.c
io_buffer.c: In function 'buf_to_str':
io_buffer.c:119:3: warning: pointer targets in passing argument 1 of 'rb_str_new' differ in signedness
c:/Ruby193/include/ruby-1.9.1/ruby/intern.h:653:7: note: expected 'const char *' but argument is of type 'uint8_t *'
compiling mini_ssl.c
In file included from mini_ssl.c:3:0:
c:/Ruby193/include/ruby-1.9.1/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h"
mini_ssl.c:4:25: fatal error: openssl/bio.h: No such file or directory
compilation terminated.
make: *** [mini_ssl.o] Error 1
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/puma-2.6.0 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/puma-2.6.0/ext/puma_http11/gem_make.out
将gem 'puma' 添加到我的Gemfile 并运行bundle install 不是一种选择,因为这对任何gem 都不起作用并给我一条错误消息(这是一个单独的问题,我已经绕过了通过gem install 安装我使用的其他gem)。
【问题讨论】:
-
听起来您可能没有为您的平台安装 openssl 标头。查看 puma issue GH#202 以获取指向 Windows 的 OpenSSL 标头的链接。
-
试试
gem install puma --source http://rubygems.org -
我在
bundle install之前运行了bundle update,这解决了这个问题。我不确定这是否是唯一有帮助的,因为我手动下载了 openssl 和gem install puma -- --with-opt-dir=c:/RailsInstaller/opensslruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
标签: ruby-on-rails ruby-on-rails-4 rubygems puma