3

我在 JRuby 中安装了 EventMachine(我使用的是 Win32)。当我尝试服务器示例时,出现错误

require 'eventmachine'

错误是:

C:\dev\em>jruby server.rb

server.rb:1:in `require': no such file to load -- eventmachine (LoadError) from server.rb:1

但是gem已安装!

C:\dev\myapp>jruby -S gem install eventmachine
Successfully installed eventmachine-0.12.8-java
1 gem installed
Installing ri documentation for eventmachine-0.12.8-java...
Installing RDoc documentation for eventmachine-0.12.8-java...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README
4

2 回答 2

8

你需要先加载RubyGems,

require 'rubygems'
于 2009-09-18T14:59:18.590 回答
0

可能没有为 jruby 安装 gem。尝试jgem install eventmachine

于 2013-07-11T18:54:05.150 回答