Thin + EventMachine fails to start

谁说我不能喝 提交于 2019-12-25 05:23:09

问题


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

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

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

Regards and thanks in advance.

Anyone came across this issue?


回答1:


I've worked around the problem dumping most of my Bundler configured gems and installing them directly on my global gemset. I had to remove all Bundler references from my Sinatra load up code and use only rubygems instead. Right now I only need Bundler for testing with cucumber and deployment with capistrano.




回答2:


try reinstall the gem 'eventmachine':

$ gem uninstall eventmachine

$ gem install eventmachine  
or 
$ bundle install

see: https://stackoverflow.com/a/15140634/445908




回答3:


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



来源:https://stackoverflow.com/questions/14610091/thin-eventmachine-fails-to-start

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