使用 Thin+ssl 时 Ruby 在 Windows 上崩溃 [英] Ruby crashes on windows on using thin+ssl

查看:36
本文介绍了使用 Thin+ssl 时 Ruby 在 Windows 上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 上使用 ruby​​(ruby 1.9.3p194(2012-04-20 修订版 35410)[i386-mswin32_90]).在我的 gemfile 中,我有以下内容:-

I am using ruby on windows(ruby 1.9.3p194 (2012-04-20 revision 35410) [i386-mswin32_90]). And in my gemfile i have following:-

gem 'rack',                      '1.4.5'
gem 'thin',                      '1.5.0'

问题是当我尝试通过指定 ssl 选项开始瘦身时:-

Problem is when i am trying to start thin with ssl option by specifying :-

ruby bin/thin --ssl  -a 127.0.0.1 -p 44466 start

我启动了服务器,但访问了 https://localhost:44466.我崩溃了 ruby​​ 并在控制台上给出了错误,然后弹出窗口说 ruby​​ 解释器已停止工作.

I starts the server, but on accessing the https://localhost:44466. I crashes ruby and gives the error on console and a popup comes saying ruby interpretor has stopped working.

"此应用程序已请求运行时以一种不寻常的方式终止它.请联系应用程序的支持团队了解更多信息."

Faulting application name: ruby.exe, version: 1.9.3.194, time stamp: 0x5154804d
Faulting module name: MSVCR90.dll, version: 9.0.30729.4940, time stamp: 0x4ca2ef57
Exception code: 0x40000015
Fault offset: 0x0005beae
Faulting process id: 0x11d4
Faulting application start time: 0x01cf7fb6cca849aa
Faulting application path: C:\Ruby19\bin\ruby.exe
Faulting module path:C:\Windows\WinSx\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_50916076bcb9a742\MSVCR90.dll

报告编号:47c368b9-ebaa-11e3-8cd8-8c89a5d53bc0`

Report Id: 47c368b9-ebaa-11e3-8cd8-8c89a5d53bc0`

我尝试了 ruby​​ 和 openssl 的不同版本.但没有运气.我在 windows 平台上使用 microsoft visual studio8 进行编译.如果我遗漏了一些步骤,请告诉我.如何删除/避免此msvcr90.dll"错误.

I tried diff versions of ruby and openssl . but no luck. I am on windows platform and compiliing using microsoft visual studio8. Please let me know if i am missing some steps. how can remove/avoid this 'msvcr90.dll' error.

 platform :- windows7
 Ruby :- ruby1.9.3p194 / ruby1.9.3p545
 Openssl :- openssl 1.0.0d/openssl 1.0.0e

请建议我是否遗漏了什么,如果 ruby​​1.9.3 mswin 有一些瘦 ssl 的问题?

Please suggest if i am missing anything, if ruby1.9.3 mswin has some issues with thin ssl?

推荐答案

经过长时间的跟进和在 windows 上尝试编译多次后,我知道了原因.

After a long follow up and trying out compilation various times on windows, I got to know the reason.

罪魁祸首是evenmachine gem.eventmachine gem 是在 MSVC 编译器上使用 WITHOUT_SSL 宏构建的.Thin 内部使用 eventmachine,这导致 ruby​​ 崩溃.

Main culprit was evenmachine gem. The eventmachine gem was built with WITHOUT_SSL macro on MSVC Compiler. And thin internally uses eventmachine and this was causing ruby to crash.

在 changein extconf.rb 为我工作后编译事件机器 gem.

Compiling event machine gem after changin extconf.rb worked for me.

diff --git a/extconf.rb b/extconf.rb.new
index 448802a..27a5b8b 100644
--- a/extconf.rb
+++ b/extconf.rb.new
@@ -25,7 +25,7 @@ end
def manual_ssl_config
  ssl_libs_heads_args = {
    :unix => [%w[ssl crypto], %w[openssl/ssl.h openssl/err.h]],
  -    :mswin => [%w[ssleay32 eay32], %w[openssl/ssl.h openssl/err.h]],
  +    :mswin => [%w[ssleay32 libeay32], %w[openssl/ssl.h openssl/err.h]],
  }

dc_flags = ['ssl']

这篇关于使用 Thin+ssl 时 Ruby 在 Windows 上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆