[英]Cannot install Puma gem on Ruby on Rails
I'm trying to install the puma gem, but when I run 我正在尝试安装美洲狮宝石,但是当我跑的时候
gem install puma
I get this error message: 我收到此错误消息:
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
Adding gem 'puma'
to my Gemfile and running bundle install
isn't an option, because that just doesn't work with any gem and gives me an error message (which is a separate issue, one that I've circumvented with the other gems I've used by installing them via gem install
). 将
gem 'puma'
添加到我的Gemfile并运行bundle install
不是一个选项,因为它不适用于任何gem并给我一个错误消息(这是一个单独的问题,我已经绕过另一个问题)我通过gem install
安装它们使用的gem install
)。
Came across very same issue. 遇到了同样的问题。
sudo apt-get install libssl-dev
fixed it for me. 为我修好了。
I ran bundle update
before bundle install
and that solved the issue for me. 我在
bundle install
之前运行了bundle update
,这解决了我的问题。
I'm not sure if that was the only thing that helped, as I manually updated puma before that, using these steps: 我不确定这是否是唯一有帮助的东西,因为我在此之前手动更新了puma,使用以下步骤:
ruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
ruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
检查openssl Ruby正在使用哪个版本ruby -v -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
gem install puma -- --with-opt-dir=C:/RailsInstaller/openssl
Figured out the solution to the puma bundle. 想出了美洲狮捆绑的解决方案。 Followed directions from https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows
以下来自https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows的指示
First you need to download: 首先你需要下载:
And then: 接着:
c:\\devkit
c:\\devkit
c:\\openssl
(use 7Zip or PeaZip) c:\\openssl
(使用7Zip或PeaZip) libeay32.dll
and ssleay32.dll
) to your ruby/bin directory. libeay32.dll
和ssleay32.dll
)中的ddls复制到ruby / bin目录。 c:\\devkit\\devkitvars.bat
(except here, I used this in command prompt instead: ruby dk.rb init
) c:\\devkit\\devkitvars.bat
(除了这里,我在命令提示符中使用了这个: ruby dk.rb init
) Now it's possible to install the puma gem with the OpenSSL packages: 现在可以使用OpenSSL包安装puma gem:
gem install puma -- --with-opt-dir=c:\openssl
I think you hit issue #430 https://github.com/puma/puma/issues/430 我认为你遇到问题#430 https://github.com/puma/puma/issues/430
Re-installing Ruby might help you as well as it closed this issue on GitHub. 重新安装Ruby可能会帮助你,也可以在GitHub上关闭这个问题。
I am using Windows 8 and couldn't get this work in development mode. 我使用的是Windows 8,无法在开发模式下完成这项工作。 Surely, it worked on production mode when I deployed to Heroku.
当然,当我部署到Heroku时,它在生产模式下工作。 Have you tried in production mode?
你有没有尝试过生产模式?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.