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@H_301_14@ reactor,require ’em/pure_ruby’ rake aborted! cannot load such file —@H_301_14@ rubyeventmachine@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in@H_301_14@ require'@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in@H_301_14@ ‘@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/thin-1.5.0/lib/thin.rb:7:in@H_301_14@ require'@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/gems/thin-1.5.0/lib/thin.rb:7:in@H_301_14@ ‘@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in@H_301_14@ require'@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in@H_301_14@ block (2 levels) in require’@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in@H_301_14@ each'@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in@H_301_14@ block in require’@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in@H_301_14@ each'@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in@H_301_14@ require’@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler.rb:128:in@H_301_14@ require'@H_301_14@ /Users/Fitz/Desktop/twilio_insanity/config/application.rb:7:in‘ /Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in@H_301_14@ require' /Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in‘@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in@H_301_14@ eval'@H_301_14@ /Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in@H_301_14@ ‘ (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

猜你在找的Ruby相关文章