Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby-kernel_require.rb:54英寸';要求';:无法加载此类文件(从GitHub存储库)_Ruby_Github_Open Source_Git Clone_Pacman - Fatal编程技术网

Ruby-kernel_require.rb:54英寸';要求';:无法加载此类文件(从GitHub存储库)

Ruby-kernel_require.rb:54英寸';要求';:无法加载此类文件(从GitHub存储库),ruby,github,open-source,git-clone,pacman,Ruby,Github,Open Source,Git Clone,Pacman,我克隆了一个GitHub目录,因为我想帮助一个开源项目 下面列出了该项目的链接,您可以自己尝试一下 根据自述,我做了以下工作 git clone https://github.com/tupini07/RubyMan cd projects/RubyMan ruby main.rb 编辑 我通过运行gem安装win32console解决了第一个问题,但仍然遇到同样的问题 错误消息 C:\Users\darkmouse\Documents\Projects\RubyMan>ruby ma

我克隆了一个GitHub目录,因为我想帮助一个开源项目

下面列出了该项目的链接,您可以自己尝试一下

根据自述,我做了以下工作

git clone https://github.com/tupini07/RubyMan
cd projects/RubyMan
ruby main.rb
编辑

我通过运行gem安装win32console解决了第一个问题,但仍然遇到同样的问题

错误消息

C:\Users\darkmouse\Documents\Projects\RubyMan>ruby main.rb
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in 
`require': cannot load such file -- 2.0/Console_ext (LoadError)
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/win32console-1.3.2-x86-mingw32/
lib/Win32/Console.rb:12:in `rescue in <top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/win32console-1.3.2-x86-mingw32/
lib/Win32/Console.rb:8:in `<top (required)>'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/win32console-1.3.2-x86-mingw32/
lib/Win32/Console/ANSI.rb:13:in `<top (required)>'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/win32console-1.3.2-x86-mingw32/
lib/win32console.rb:1:in `<top (required)>'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from C:/Users/darkmouse/Documents/Projects/RubyMan/Board.rb:2:in `<top (required)>'
from main.rb:4:in `require_relative'
from main.rb:4:in `<main>'
Board.rb

3 require_relative 'player'
4 require_relative 'Board'
5 require_relative 'LoadLevel'
2 require 'win32console'
以上列出了这些问题

我运行Windows8操作系统


我不想用问题轰炸存储库,所以我决定在这里提问

我创建了同一个GitHub项目RubyMan,并在Ubuntu 14.04 LTS上克隆了它。我安装了Ruby 2.2.2的最新稳定版本。当我切换到RubyMan文件夹并运行时,遇到了与上面几乎相同的问题:

ruby Main.rb
以下是堆栈跟踪:

/usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- colorize (LoadError)
    from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/ashok/RubyMan/Board.rb:1:in `<top (required)>'
    from Main.rb:3:in `require_relative'
    from Main.rb:3:in `block in <main>'
    from Main.rb:3:in `each'
    from Main.rb:3:in `<main>'
结果:

Successfully installed colorize-0.7.7
RubyGems system software updated
Successfully installed colorize-0.7.7
What size will the board be?
不幸的是,上述问题并没有消失:(我尝试了许多其他的建议。运气不好

但是,这两个步骤解决了问题: 步骤1:

结果:

Successfully installed colorize-0.7.7
RubyGems system software updated
Successfully installed colorize-0.7.7
What size will the board be?
我知道这会将所有已安装的gems更新为其最新版本

步骤2:

结果:

Successfully installed colorize-0.7.7
RubyGems system software updated
Successfully installed colorize-0.7.7
What size will the board be?
现在我可以通过运行以下命令启动RubyMan程序:

ruby Main.rb
结果:

Successfully installed colorize-0.7.7
RubyGems system software updated
Successfully installed colorize-0.7.7
What size will the board be?

当我输入一个数字时,它会显示2D RubyMan游戏准备好玩了!

你能发布整个堆栈跟踪吗?按堆栈跟踪,你是指错误消息吗?是的。它应该显示每一行/方法调用出错的地方。它看起来像是require relative的问题。我已经发布了完整的跟踪。看起来你需要宝石。