Thin + EventMachine fails to start
Asked Answered
G

3

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?

Giesecke answered 30/1, 2013 at 17:30 Comment(4)
Perhaps you need to install eventmachine on your Red Hat server?Lias
gem install eventmachine ? I'm using bundler to install it.Giesecke
Can you also confirm that you have Xcode installed?Papyraceous
ianin, it's a Red Hat Enterprise Server :) In my OSX works fine.Giesecke
G
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.

Giesecke answered 31/1, 2013 at 10:32 Comment(3)
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.Papyraceous
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.Giesecke
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.Papyraceous
A
0

try reinstall the gem 'eventmachine':

$ gem uninstall eventmachine

$ gem install eventmachine  
or 
$ bundle install

see: https://mcmap.net/q/392498/-rails-cannot-run-app-unable-to-load-the-eventmachine-c-extension

Armor answered 19/12, 2013 at 10:1 Comment(0)
K
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

Kraus answered 8/4, 2018 at 23:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.