本文介绍了Thin + EventMachine 无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在为 sinatra 应用程序加载瘦网络服务器时,我不断收到

While loading a Thin webserver for a sinatra app I keep getting

Unable to load the EventMachine C extension; To use the pure-ruby reactor, require em/pure_ruby'<path>/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:8:in `require': cannot load such file -- rubyeventmachine (LoadError)
from <path>/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:8:in `<top (required)>'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin.rb:7:in `require'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin.rb:7:in `<top (required)>'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:5:in `require'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:5:in `<top (required)>'
from <path>/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
from <path>/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'

在我的 Mac OSX 中,我启动服务器没有任何问题,但在我的服务器中,这是一个红帽企业 Linux 服务器 6.2 版(圣地亚哥)我无法启动我的应用.

In my Mac OSX I boot the server without any problems but in my server which is aRed Hat Enterprise Linux Server release 6.2 (Santiago)I can't start my app.

我使用的是 rvm 1.18.5 和 ruby​​-1.9.3-p374

I'm using rvm 1.18.5 and ruby-1.9.3-p374

提前致以问候和感谢.

有人遇到过这个问题吗?

Anyone came across this issue?

推荐答案

我通过卸载自制的 ruby​​ 2.5 版本修复了无法加载 EventMachine C 扩展"错误.请参阅关于 创建数据库时出现Rails/Ruby错误:无法加载EventMachine C扩展

I fixed my "Unable to load the EventMachine C extension" error by uninstalling homebrew's version of ruby 2.5. See this comment on Rails/Ruby Error When Creating Database: Unable to load the EventMachine C extension

这篇关于Thin + EventMachine 无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 14:16