需要“Qt4”时出现问题在 Ruby 1.8.7 中
我已成功安装:
- Ruby 1.8.7-p334
- Rubygems 1.7.2
- rake 0.9.0
- qtruby4 2.1.0 mswin32 strong>
现在下面的代码块
require 'rubygems'
require 'Qt4'
给了我一个错误:
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:926:in
report_activate_error': RubyGem 版本错误: qtruby4(2.1.0 不 >= 0) (Gem::LoadError) 来自 C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:244:in
activate_dep' 来自 C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:236:inactivate' 来自 C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:213:in
try_activate' 来自 C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:56:in `require' 来自 C:/Users/nick/Documents/NetBeansProjects/RubyApplication2/lib/main.rb:4
当只需要“rubygems”时一切都很好。我的操作系统是 Windows 7。
I have successfully installed:
- Ruby 1.8.7-p334
- Rubygems 1.7.2
- rake 0.9.0
- qtruby4 2.1.0 mswin32
Now the following block of code
require 'rubygems'
require 'Qt4'
gives me an error:
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:926:in
report_activate_error': RubyGem version error: qtruby4(2.1.0 not >= 0) (Gem::LoadError)
activate_dep'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:244:in
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:236:inactivate'
try_activate'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:213:in
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:56:in `require'
from C:/Users/nick/Documents/NetBeansProjects/RubyApplication2/lib/main.rb:4
Everything good when requiring just 'rubygems'. My OS is Windows 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您需要正确的宝石名称,
要求“Qt4”似乎没什么不同,因为几乎所有红宝石宝石名称都是简单的字母,
这不是您的宝石名称“qtruby4”,如果是这样,请尝试
HTH
Sameera
Make sure you require correct gem name
require 'Qt4' seems like little different as almost all the ruby gem names are in simple letters
isnt your gem name 'qtruby4' by any chance, if so try
HTH
sameera