我无法在简单的测试程序中要求 EventMachine。我正在运行 Ruby 1.9.2 (x86_64-darwin10.4.0) 和 Rails 3.0.1。EventMachine 已安装(通过gem install eventmachine
)并且 gem 知道它:
宝石列表--本地 *** 当地宝石 *** 摘要 (1.0.0) ... 厄鲁比斯 (2.6.6) 事件机(0.12.10) i18n (0.4.2) ... tzinfo (0.3.23)
然而,当我启动 rails 控制台(通过rails console
)并且只需要 eventmachine 时,它就会爆炸:
ruby-1.9.2-p0 > 需要'rubygems' => 无 ruby-1.9.2-p0 > 需要'eventmachine' LoadError:没有要加载的文件--eventmachine 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in 'require' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in 'block in require' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in 'block in load_dependency' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in 'new_constants_in' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in 'load_dependency' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in 'require' 来自 (irb):2 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands/console.rb:44:in 'start' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands/console.rb:8:in 'start' 来自 /Users/russ/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.1/lib/rails/commands.rb:23:in '<top (required)>' 来自脚本/rails:6:in 'require' 来自脚本/rails:6:in '<main>'
我尝试在需要 EventMachine 的类中运行方法时得到相同的结果。EventMachine 构建没有错误。我一遍又一遍地卸载了 EventMachine 和 Ruby 以及所有的 gem,但我无法完成这项工作。谁能指出我正确的方向?
-拉斯