ruby 环境(1.9.3-xp 的)能正常工作。
网上 gtk 教程第一段代码就运行不正常。
#!/usr/bin/ruby
require "gtk2"
class RubyApp < Gtk::Window
def initialize
super
set_title "Center"
signal_connect "destroy" do
Gtk.main_quit
end
set_default_size 250, 200
set_window_position
bGtk::Window::POS_CENTER
show
end
end
Gtk.init
window = RubyApp.new
Gtk.main
报如下错误:
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- gtk2 (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
require'
from D:/Ruby_test/gtk_test/test1.rb:3:in `
请帮忙看下,感激!