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
How to Print Stdout Immediately
How to Stop Rails' Built-In Server from Listening on 0.0.0.0 by Default
Using Phonegap as a Native Container for a Rails 3 App
Optional Parens in Ruby for Method with Uppercase Start Letter
Migrating from Local Paperclip Storage to S3
Generate Activerecord Schema from an Existing Table
Understanding Namespaces in Ruby
Is There a Ruby Method That Just Returns the Value of a Block
How to Force a Cucumber Scenario to Fail
How to Convert 270921Sec into Days + Hours + Minutes + Sec ? - Ruby
How to Write to File When Using Marshal::Dump in Ruby for Object Serialization
R Statistical Package Gem for a Rails Application
How to Convert Any Method to Infix Operator in Ruby
Keyword Arguments Unpacking (Splat) in Ruby
Using Nokogiri to Split Content on Br Tags
Cannot Start Rails Server, "No Such File to Load -- Bundler/Setup"