JRuby EventMachine 没有要加载的文件

发布于 2024-08-04 16:59:17 字数 705 浏览 7 评论 0原文

我已经在 J​​Ruby 中安装了 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

I have intalled EventMachine in JRuby (I am using Win32). When I try the server example, I get an error when

require 'eventmachine'

The error is:

C:\dev\em>jruby server.rb

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

But the gem is installed!

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落叶缤纷 2024-08-11 16:59:17

您需要首先加载 RubyGems,

require 'rubygems'

You need to first load RubyGems,

require 'rubygems'
迷途知返 2024-08-11 16:59:17

jruby 可能未安装 gem。尝试jgem install eventmachine

The gem may not be installed for jruby. Try jgem install eventmachine

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文