Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.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
在windows上运行ruby脚本_Ruby_Windows_Github - Fatal编程技术网

在windows上运行ruby脚本

在windows上运行ruby脚本,ruby,windows,github,Ruby,Windows,Github,我已经从GitHub下载了存储库的克隆,并使用安装了ruby,我希望能够运行该示例,但我可能错过了一些东西,因为即使测试也没有运行 这是我想说的话 Linguist::FileBlob.new("lib/linguist.rb").language.name #=> "Ruby" 以下是库的内容: 这是测试文件夹: 当我试图从tests文件夹中运行test\u blob.rb文件时,出现以下错误: 无法加载这样的文件 请尝试Linguist::FileBlob.new(“../li

我已经从GitHub下载了存储库的克隆,并使用安装了ruby,我希望能够运行该示例,但我可能错过了一些东西,因为即使测试也没有运行

这是我想说的话

Linguist::FileBlob.new("lib/linguist.rb").language.name #=> "Ruby"
以下是库的内容:

这是测试文件夹:

当我试图从tests文件夹中运行
test\u blob.rb
文件时,出现以下错误:

无法加载这样的文件


请尝试Linguist::FileBlob.new(“../lib/Linguist.rb”)。language.name还可以从Linguist\test文件夹运行该文件。我尝试从该文件夹运行测试脚本,但遇到了相同的错误。您的意思是我应该使用该行代码在测试文件夹中创建一个文件并运行它?我试过了,但失败了——“未初始化常量语言学家(NameError)”,你的路径有问题吗?这是一个
require…
错误,因此它告诉您它找不到文件
语言学家/file\u blob
。请注意,这不是一条绝对路径。那么首先,您是否在您克隆的repo中的哪个位置安装了
捆绑包
?能否显示您的
路径
环境变量?