【问题标题】:EventMachine gem workaround causes missing dll file ruby error, Windows 7EventMachine gem 解决方法导致缺少 dll 文件 ruby​​ 错误,Windows 7
【发布时间】:2011-11-29 21:57:56
【问题描述】:

克隆我的第一个 Rails 3.1.1 应用程序后,我的第一个包安装在 eventmachine 0.12.10 gem 上阻塞。 (我正在运行 Windows 7 32 位)

我也在使用 gem 'thin'。

我发现这个帖子有同样的问题。

Which version of eventmachine is able to work in windows?

我在我的 gemfile 中与这一行集成:

gem "eventmachine", ">= 1.0.0.beta"

这允许捆绑安装运行,但是当我启动 rails 服务器时,我得到一个带有标题 ruby​​.exe - 系统错误和文本的 Ruby 弹出窗口

The program can't start because libgcc_s_sjlj-1.dll is missing from your computer.  Try reinstalling the program to fix this problem.

单击“确定”后,我在控制台中收到此消息

Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'

后面是长堆栈跟踪(请求查看您是否认为这会有所帮助)。

我看到 EventMachine gem 需要 C++ 编译器。我在我的 32 位 Windows 7 机器上重新安装了 MinGW,并将 MinGW\bin 添加到我的 PATH 变量中。

但是当我查看那个 bin 文件夹时,文件 libgcc_s_sjlj-1.dll 不存在并且相同的错误消息仍然存在。我发现这个线程是关于 2009 年缺少该文件夹的,但我不确定该怎么做。

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539033

感谢您能给我的任何帮助。

【问题讨论】:

  • 欢迎来到 windows/linux 兼容性地狱!这些开源工具不是为 Windows 设计的。根据我的经验,当你解决了这个问题时,你只会遇到另一个问题,直到你放弃。我已经经历过了。我建议一个侧面解决方案:在您的 Windows 机器上运行虚拟化 linux。这是我使用的,它工作得很好,你有 apt-get,一切都会立即工作。

标签: c++ windows-7 ruby-on-rails-3.1 gem eventmachine


【解决方案1】:

我通过添加解决了这个问题

require "em/pure_ruby"

在 config/application.rb 中

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    将此添加到您的 gem 文件中

    gem 'eventmachine', '1.0.0.beta.4.1'
    

    另请注意,如果您切换回基于 unix 的操作系统,则必须使用 1.0.0.beta.4。

    【讨论】:

    • 换句话说,只需 gem 'eventmachine', ">= 1.0.0.beta.4", "<= 1.0.0.beta.4.1" 就可以跨平台!
    【解决方案3】:

    这可能是因为 eventmachine 动态链接到 mingw dll。

    你可以:

    require 'devkit'
    

    在脚本的顶部。这将使用 mingw devkit 的路径暂时增强您的路径。

    Source

    【讨论】:

      猜你喜欢
      • 2012-10-04
      • 2012-08-08
      • 2015-08-29
      • 2013-06-15
      • 1970-01-01
      • 2012-03-15
      • 2023-01-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多