2017-06-17 73 views
0

我最近在Windows OS 8.1(Surface Pro 2)上安裝了Ruby 2.3和Gosu 2d遊戲開發庫。兩者的安裝都很快且成功。使用庫我寫了一個基本的程序(使用Sublime Text 3)意味着生成一個空白窗口。控制檯繼續在調試儘管我試圖返回此錯誤消息:Gosu庫與Windows 8.1不兼容(ruby 2.3)

C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- gosu.so (LoadError) 
    from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/gosu-0.12.0-x64-mingw32/lib/gosu.rb:17:in `<top (required)>' 
    from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require' 
    from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require' 
    from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:40:in `require' 
    from C:/Users/Kevin/Desktop/Clone/clone.rb:1:in `<main>' 
[Finished in 0.7s with exit code 1] 
[shell_cmd: ruby "C:\Users\Kevin\Desktop\Clone\clone.rb"] 
[dir: C:\Users\Kevin\Desktop\Clone] 
[path: C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Ruby24-x64\bin] 

下面是基本的程序中,我寫道:>>>

require "gosu" 

class GameWindow < Gosu::Window 
    def initialize width=500, height=500, fullscreen=false 
     super 
     self.caption = "Clone" 
    end 

    def update 
    end 

    def draw 
    end 
end 

GameWindow.new.show 

< < <

我很新到一般的編程,所以我試圖解釋這個錯誤信息是徒勞的。我在OSX Sierra的MacBook上安裝並使用了Gosu,並且所有的工作都像它應該那樣,導致我相信問題與操作系統有關。我知道過去由於系統依賴性問題,Windows操作系統上的Gosu庫存在多個問題,但是對這些問題的解決方案已被證明是無益的。有人可以向我解釋這個錯誤信息嗎? Gosu庫可能與Windows操作系統8.1不兼容,或者在Windows上設置Gosu的步驟是否可以跳過?

我將不勝感激任何幫助,我可以得到。

回答

0

問題標題提到了Ruby 2.3,但是從錯誤消息看來,您似乎正在使用Ruby 2.4。 Gosu 0.12.0與Ruby 2.4不兼容,但是Gosu 0.12.1是。請運行gem update gosu並重試,這應該可以解決問題。