Rails/Ruby Error When Creating Database: Unable to Load the Eventmachine C Extension

Rails/Ruby Error When Creating Database: Unable to load the EventMachine C extension

Someone kind of answered in comments...see below.

Basically though I had seperate versions of Ruby, which was getting confusing because some gems were only installed on certain versions of ruby.

Fix was totally uninstalling ruby and rails, then reinstalling. Fixed it!

This helped:

This comment in another thread seems promising for your issue. Can you ensure that you have "gem eventmachine" or similar in your Gemfile, and can successfully bundle? – Scott Helm Jan 6 at 6:24

Cannot load Ruby EventMachine in Rails console - no such file to load

Rails 3 uses Bundler by default, what this means is that you need to specify all your dependencies in the Gemfile like this:

gem "eventmachine"

(install any not installed via bundle install).

Bundler handles dependency management, which means you can lock down your gem versions, and avoid conflicts nicely, but conversely, this means it won't load anything that isn't specified in your Gemfile.

This also means if you want to run your development webserver on something nicer than webrick, you may want to add something like this to your gemfile too

group :development do
gem 'mongrel'
gem 'ruby-debug'
end

Ruby on Rails: cannot load such file eventmachine

I just found out that bundler wasn't pulling in eventmachine; I had to update my gemfile to require it. Turns out 'gem list' is for your machine's ruby, not your porject gems. I hope this helps anyone else who might run into a similar issue



Related Topics



Leave a reply



Submit