简体   繁体   English

Gosu库与Windows 8.1(Ruby 2.3)不兼容

[英]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). 我最近在Windows OS 8.1(Surface Pro 2)上安装了Ruby 2.3和Gosu 2d游戏开发库。 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. 使用该库,我编写了一个用于生成空白窗口的基本程序(使用Sublime Text 3)。 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. 我在装有OSX Sierra的MacBook上安装并使用Gosu,并且一切正常进行,这使我相信问题与操作系统有关。 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. 我知道过去由于系统依赖性问题,Windows OS上的Gosu库存在多个问题,但是事实证明,解决这些问题无济于事。 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? Gosu库是否可能与Windows OS 8.1不兼容,或者只是跳过了在Windows上设置Gosu的一个步骤?

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. 问题标题提到了Ruby 2.3,但是从错误消息看来,您正在使用Ruby 2.4。 Gosu 0.12.0 wasn't compatible with Ruby 2.4, but Gosu 0.12.1 is. Gosu 0.12.0与Ruby 2.4不兼容,但是Gosu 0.12.1是兼容的。 Please run gem update gosu and try again, that should fix the issue. 请运行gem update gosu然后重试,这样可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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