为什么我用 Ruby1.8.7 就能 require‘Qt’,用 1.9.3 就出现:
cannot load such file -- Qt
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from (irb):1
from /usr/bin/irb:12:in `
求解??
#1 楼 @windwiny 我删除了 rubygems,重新下载了 ruby1.9.3,并且安装了 qtbindings 然后 gem list 里面有: minitest (4.7.5) multi_json (1.8.2) qtbindings (4.8.5.2) tzinfo (0.3.38)
再 require‘Qt’,还是不行
irb(main):004:0> require 'Qt'
NameError: uninitialized constant Qt::RubyThreadFix::Queue
from /var/lib/gems/1.9.1/gems/qtbindings-4.8.5.2/lib/Qt4.rb:30:in const_missing'
from /var/lib/gems/1.9.1/gems/qtbindings-4.8.5.2/lib/Qt4.rb:30:in
class:RubyThreadFix'
from /var/lib/gems/1.9.1/gems/qtbindings-4.8.5.2/lib/Qt4.rb:26:in <module:Qt>'
from /var/lib/gems/1.9.1/gems/qtbindings-4.8.5.2/lib/Qt4.rb:25:in
'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from /var/lib/gems/1.9.1/gems/qtbindings-4.8.5.2/lib/Qt.rb:1:in <top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require'
from (irb):4
from /usr/bin/irb:12:in
被提示:
irb(main):001:0> require 'Qt'
Traceback (most recent call last):
4: from /usr/bin/irb:11:in <main>'
3: from (irb):1
2: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in
require'
1: from /usr/local/lib/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
LoadError (cannot load such file -- Qt)
版本是 2.5.0,看来是真的不支持高版本,好可惜。希望 JIT 的 2.6 未来能支持