i got trouble, in a rails project(redmine2.3), rails version is 3.2
start the project
bundle exec thin start -p 8080 -e production -s 5 -d
error info
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
/var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `require': libruby.so.2.0: cannot open shared object file: No such file or directory - /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/rubyeventmachine.so (LoadError)
from /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `load'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `<main>'
the same error happens when running rails -v
rails -v
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
running bundle exec .....
in the project produces the same error
the problem has solved, see my comment in the third floor , there are the answer
If you are using windows
Go to this folder C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\eventmachine-1.2.5-x64-mingw32\lib
open this file eventmachine.rb
require 'em/pure_ruby'
in the first line of code in the filethis will make it work with no issues.
I was encountering this error message on Windows 10 while trying to use Jekyll's LiveReload feature. The other answers here did not solve the problem completely, or risked having the issue re-occur the next time bundle install
is run.
My solution (taken from this site) was to:
Run this console command
gem uninstall eventmachine
and choose to uninstall eventmachine-1.2.7-x64-mingw32
gems from your system.
Edit Gemfile
inside your project directory and add this line inside:
gem 'eventmachine', '1.2.7', git: 'https://github.com/eventmachine/eventmachine.git', tag: 'v1.2.7'
Run
bundle install
Clean up your jekyll build and cache with command
bundle exec jekyll clean
You can now use the --livereload
parameter without getting any issue, even if you execute bundle install
in future.
For Ruby 2.4 & eventmachine 1.2.6 on Windows 10.
You gotta uninstall first eventmachine
and then install it again with platform ruby:
gem uninstall eventmachine (select all versions if prompted)
gem install eventmachine --platform ruby
The relevant error message here is the following:
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
Try to reinstall the eventmachine
gem:
gem uninstall eventmachine
bundle install
See Rails/Ruby Error When Creating Database: Unable to load the EventMachine C extension and Rails - cannot run app: Unable to load the EventMachine C extension; for more advice on how to deal with this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With