创建数据库时出现

创建数据库时出现

本文介绍了创建数据库时出现 Rails/Ruby 错误:无法加载 EventMachine C 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:

eventmachine gem 已安装并在我的 gemfile 中:

the eventmachine gem is installed and in my gemfile:

 eventmachine (1.0.0, 0.12.10)

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

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

返回以下错误:

无法加载 EventMachine C 扩展;使用纯红宝石反应堆,要求 'em/pure_ruby' 耙子中止!无法加载此类文件——红宝石事件机/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'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in要求'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:inblock(2 级)在 require'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in每个'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:inblock in require'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in每个'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in要求'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib/bundler.rb:128:in要求'/Users/Fitz/Desktop/twilio_insanity/config/application.rb:7:in'/Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in需要'/Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in评估'/Users/Fitz/.rvm/gems/ruby-1.9.3-p327@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in'(通过使用 --trace 运行任务查看完整跟踪)

```

推荐答案

有人在评论中回答...见下文.

Someone kind of answered in comments...see below.

基本上,虽然我有不同版本的 Ruby,但由于某些 gem 只安装在某些版本的 ruby​​ 上,这让我感到困惑.

Basically though I had seperate versions of Ruby, which was getting confusing because some gems were only installed on certain versions of ruby.

修复完全卸载 ruby​​ 和 rails,然后重新安装.修好了!

这有帮助:

此评论在另一个线程中似乎对您的问题很有希望.你能确保你的 Gemfile 中有gem eventmachine"或类似的东西,并且可以成功捆绑吗?– 斯科特赫尔姆 1 月 6 日 6:24

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

这篇关于创建数据库时出现 Rails/Ruby 错误:无法加载 EventMachine C 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 14:15