Ruby crashes on windows on using thin+ssl

自古美人都是妖i 提交于 2019-12-11 04:48:21

问题


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'

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

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.

"This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

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

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

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

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


回答1:


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

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.

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']


来源:https://stackoverflow.com/questions/23906850/ruby-crashes-on-windows-on-using-thinssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!