简体   繁体   English

Rails Server (Puma):SSL 在此版本中不可用(标准错误)

[英]Rails Server (Puma): SSL not available in this build (StandardError)

I am trying to run Rails development server over HTTPS using a Self-Signed SSL Certificate.我正在尝试使用自签名 SSL 证书通过HTTPS运行 Rails 开发服务器。 But when I start the rails server using:但是当我使用以下命令启动 rails 服务器时:

rails s -b "ssl://0.0.0.0:8080?key=localhost.key&cert=localhost.crt"

It is giving me following error:它给了我以下错误:

C:/Ruby23/lib/ruby/gems/2.3.0/gems/puma-3.11.0/lib/puma/binder.rb:149:in `check': SSL not available in this build (StandardError)

I am using ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]我正在使用 ruby​​ 2.3.3p222 (2016-11-21 修订版 56859) [i386-mingw32]

It's fairly difficult to use puma with SSL on RubyInstaller-2.3, since you need to install OpenSSL on you own and convince puma to link to it.在 RubyInstaller-2.3 上使用带有 SSL 的 puma 相当困难,因为您需要自己安装 OpenSSL 并说服 puma 链接到它。 Fortunately this issue is solved with RubyInstaller-2.4 and newer.幸运的是,RubyInstaller-2.4 和更新版本解决了这个问题。 You need to install OpenSSL package and install puma afterwards, so that it's built with SSL support:您需要安装 OpenSSL 包并在之后安装 puma,以便它使用 SSL 支持构建:

ridk exec pacman -S mingw-w64-x86_64-openssl   &:: download+install OpenSSL 
gem inst puma        &:: (re-)install puma, it should find openssl libs
bundle update puma   &:: Optionally make sure the just installed puma version is used

See also related issue on rubyinstaller2: https://github.com/oneclick/rubyinstaller2/issues/81另请参阅 ruby​​installer2 上的相关问题: https : //github.com/oneclick/rubyinstaller2/issues/81

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

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