0

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?

Nuno Valente
  • 35
  • 1
  • 4

3 Answers3

0

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.

Nuno Valente
  • 35
  • 1
  • 4
  • 1
    I suggest using `bundler install --binstubs --path vendor`. It's much easier to sandbox a project's gems this way if you're using Bundler than by using an RVM gemset. – ian Jan 31 '13 at 16:16
  • iain I've also tried that. Actually I always use Bundler for my projects and this is the first time this is happening to me. I don't know what went wrong with the latest versions of Bundler + RVM but I'm having some weird behaviors at my servers. – Nuno Valente Jan 31 '13 at 23:53
  • 1
    I'd clear out all my RVM gems, then `rm -rf .bundle Gemfile.lock bin vendor` in the project, then reinstall Bundler, and then use the binstubs+vendor switches. – ian Feb 01 '13 at 00:04
0

try reinstall the gem 'eventmachine':

$ gem uninstall eventmachine

$ gem install eventmachine  
or 
$ bundle install

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

Community
  • 1
  • 1
Siwei
  • 19,858
  • 7
  • 75
  • 95
0

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

Chris Houhoulis
  • 535
  • 4
  • 5