【问题标题】:Why can't I run RubyGame? [closed]为什么我不能运行 RubyGame? [关闭]
【发布时间】:2014-02-22 07:31:47
【问题描述】:

我按照RubyGame wiki 的说明进行操作。在我尝试运行应用程序之前一切正常:

ruby a_rubygame_app.rb

# => ruby: No such file or directory -- a_rubygame_app.rb (LoadError)

发生了什么?

【问题讨论】:

    标签: ruby macos installation rubygame


    【解决方案1】:

    a_rubygame_app.rb 不是任何文件的实际名称...在安装文档中,他们使用了一种常见的程序员技术,即用看起来需要替换的东西来命名文件。

    这通常使用 /path/to/yourfile 之类的东西来完成 - 这不是您计算机上任何实际文件的路径,而是要替换为实际路径和文件名 - 或 obj.my_method,它旨在表明您通过将 my_method 替换为实际方法名称来调用您创建的方法。

    根据 ruby​​game README,

    We also recommend that you take a peek at the demo applications in
    the 'samples' directory, especially image_viewer.rb,
    demo_rubygame.rb, and chimp.rb.
    

    尝试找到进入samples 目录的方法,然后尝试运行ruby image_viewer.rbruby demo_rubygame.rbruby chimp.rb

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多