Rails - Cannot Run App: 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

Eventmachine gem install fail

I could install it, doing this steps:

1) tried a normal install:

gem install eventmachine

it fetched the version 1.0.3 of the gem, but failed in the make, because of a variable declaration conflit

2) edited the file:

c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext\project.h

and commented the line 97

//typedef int pid_t;

for a more robust correction, checkout the solution here https://github.com/eventmachine/eventmachine/pull/450/files

3) then, i've opened command prompt, and went to the gem folder

c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3

and run:

gem build eventmachine.gemspec

You need git installed with the git.exe location in the PATH for this to work (such as C:\Users\YourUsername\AppData\Local\GitHub\PORTAB~1\bin).

4) it generated a eventmachine.gem file on the folder... So I've copied a file to a c:\tmp folder, and went to that folder and from there, I've typed:

gem install eventmachine-1.0.3.gem --local

And it installed successfully!



Related Topics



Leave a reply



Submit