简体   繁体   中英

Gosu library incompatibility with windows 8.1 (ruby 2.3)

I recently installed Ruby 2.3 and the Gosu 2d game development library on Windows OS 8.1 (Surface Pro 2). The installation of both was quick and successful. Using the library I wrote a basic program (using Sublime Text 3) meant to generate a blank window. The Console continued to return this error message despite my attempts at debugging:

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]

Here is the basic program I wrote: >>>

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

<<<

I am very new to programming in general, so my attempts to interpret this error message have been futile. I installed and used Gosu on my MacBook with OSX Sierra and everything worked like it should, leading me to believe the problem is OS related. I know there have been multiple problems with the Gosu library on Windows OS in the past because of system dependency issues, but resolutions to those issues have proven unhelpful. Could someone please explain to me this error message? Is it possible that the Gosu library is incompatible with Windows OS 8.1 or is there just a step for setting up Gosu on Windows that I skipped?

I would appreciate any help I can get.

The question title mentions Ruby 2.3, but from the error message it seems you are using Ruby 2.4. Gosu 0.12.0 wasn't compatible with Ruby 2.4, but Gosu 0.12.1 is. Please run gem update gosu and try again, that should fix the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM