问题
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