ruby-on-rails – 创建数据库时出现Rails / Ruby错误:无法加载EventMachine C扩展

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 创建数据库时出现Rails / Ruby错误:无法加载EventMachine C扩展前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
更新:

eventmachine gem已安装在我的gemfile中:

eventmachine (1.0.0,0.12.10)

请帮忙!尝试使用以下内容创建数据库

Fitzs-MacBook-Pro:twilio_insanity Fitz$rake db:create'

返回以下错误

Unable to load the EventMachine C extension; To use the pure-ruby
reactor,require ’em/pure_ruby’ rake aborted! cannot load such file —
rubyeventmachine
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in

/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/thin-1.5.0/lib/thin.rb:7:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/thin-1.5.0/lib/thin.rb:7:in

/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in
block (2 levels) in require’
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in
each'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in
block in require’
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in
each'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in
require’
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler.rb:128:in
require'
/Users/Fitz/Desktop/twilio_insanity/config/application.rb:7:in
‘ /Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in
require' /Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in
eval'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in
‘ (See full trace by running task with –trace)

“`

解决方法

尝试重新安装gem’eventmachine’
$gem uninstall eventmachine

然后

$bundle install  ( in the same folder with your Gemfile)

要不就

$gem install eventmachine ( if you are not using the Gemfile)

见:https://stackoverflow.com/a/15140634/445908

原文链接:https://www.f2er.com/ruby/274180.html

猜你在找的Ruby相关文章