我正在尝试安装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
)安排了我使用过的其他宝石。
答案 0 :(得分:13)
遇到了同样的问题。
sudo apt-get install libssl-dev
为我修好了。
答案 1 :(得分:9)
我在bundle update
之前运行bundle install
,这解决了我的问题。
我不确定这是否是唯一有帮助的,因为我在此之前手动更新了puma,使用以下步骤:
ruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
gem install puma -- --with-opt-dir=C:/RailsInstaller/openssl
答案 2 :(得分:5)
找出puma捆绑的解决方案。来自https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows
的指示首先你需要下载:
然后:
c:\devkit
c:\openssl
(使用7Zip或PeaZip)libeay32.dll
和ssleay32.dll
)中的ddls复制到ruby / bin目录。c:\devkit\devkitvars.bat
(除此处,我在命令提示符中使用此代码:ruby dk.rb init
)现在可以使用OpenSSL软件包安装puma gem:
gem install puma -- --with-opt-dir=c:\openssl
答案 3 :(得分:3)
我认为你遇到问题#430 https://github.com/puma/puma/issues/430
重新安装Ruby可能会对您有帮助,并且它会在GitHub上关闭此问题。
答案 4 :(得分:0)
我使用的是Windows 8,无法在开发模式下完成此项工作。当然,当我部署到Heroku时,它在生产模式下工作。你试过生产模式吗?