设置 Ruby Koans

发布于 2024-10-31 01:36:36 字数 648 浏览 0 评论 0原文

这个问题可能非常愚蠢/n00bish/不适当/本地化/闪闪发光的蛋糕,所以只要我得到答案,你就可以投反对票,因为我非常希望能够通过公案。 :)

我正在尝试让 这个 工作。 (GitHub 位于此处)我已经下载并解压了它,该文件夹位于我的 Documents 目录中(我将其从默认名称重命名为 ruby​​_koans)。我一整天都在搞这个,但无法让它在 Konsole 中运行。 :/

我用来

cd /home/sophia/Documents

移动到 Documents 目录,其中包含 ruby​​_koans 文件。

我不知道之后该做什么,因为 Rake 似乎坏了,我可能安装了 自动测试不正确:S

而且,在在这里发帖之前,我已经在 freenode 上询问了 #ruby 和 #kubuntu。 ._.

This question is probably pretty stupid/n00bish/inappropriate/localised/sparkly cake, so downvote all you like as long as I get the answer, as I wish very much to be able to go through the koans. :)

I am trying to get this to work. (GitHub is here) I've downloaded and extracted it, and the folder is in my Documents directory (I renamed it ruby_koans from the default name). I've been messing around with this all day and can't get it to run in Konsole. :/

I use

cd /home/sophia/Documents

to move to the directory Documents, which contains the ruby_koans file.

I have no idea what to do after that, as Rake seems to be broken, and I probably installed Autotest incorrectly :S

And, before posting here, I already asked #ruby and #kubuntu on freenode. ._.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

逆夏时光 2024-11-07 01:36:36

尝试从 http://rubykoans.com/ 安装 koans
他们有详细的安装说明和故障排除部分。

如果由于某种原因仍然无法正常工作,那么您应该向以前做过此操作的现实程序员朋友寻求帮助:)

旧答案:

请尝试运行“path_to_enlightenment.txt”。 “koans”目录中的“rb”文件。

cd koans
ruby path_to_enlightenment.rb

那不使用耙子。如果这不起作用,那么您的 ruby​​ 安装可能已损坏。

“path_to_enlightenment”的第一行是:

LOAD_PATH << File.dirname(__FILE__).

这使得“require”在当前目录中查找文件。
也许 File.dirname(__FILE__) 没有返回正确的值(由于某种原因)。
尝试将 File.dirname(__FILE__) 替换为 koans 所在目录的绝对路径。即“/home/MYUSERNAME/ruby_koans/koans/”。
如果我不得不猜测,我会说问题是“Documents”文件夹中有一个大写的 D。您还可以尝试将项目移到其他地方。

Try to install the koans from http://rubykoans.com/
They have detailed installation instructions and a troubleshooting section.

If for some reason things still don't work properly, then you should seek help from a real-life programmer friend who has done this before :)

old answer:

Please, try to run the "path_to_enlightenment.rb" file inside the "koans" directory.

cd koans
ruby path_to_enlightenment.rb

That doesn't use rake. If that doesn't work, then your ruby installation may be broken.

The first line of the "path_to_enlightenment" is:

LOAD_PATH << File.dirname(__FILE__).

This makes "require" look for files in the current directory.
Perhaps File.dirname(__FILE__) does not return the proper value(for some reason).
Try and replace File.dirname(__FILE__) with the absolute path of the directory in which the koans are. I.e. "/home/MYUSERNAME/ruby_koans/koans/".
If I had to guess, I'd say the problem is that the "Documents" folder has an uppercase D in it. You can also try and move the project somewhere else.

复古式 2024-11-07 01:36:36
git clone https://github.com/renemendoza/ruby_koans.git
cd ruby_koans/koans
autotest

如果尚未安装自动测试,您需要执行gem install autotest

打开每个脚本并根据提示填写正确答案。当您保存更改时,自动测试应该重新运行并显示下一个失败的测试。

git clone https://github.com/renemendoza/ruby_koans.git
cd ruby_koans/koans
autotest

If autotest is not already installed, you'll need to do gem install autotest.

Open each script and fill in the correct answers as prompted. When you save changes autotest should rerun and show you the next failing one.

ぃ弥猫深巷。 2024-11-07 01:36:36

对于那些从 renmendozaneall 版本的公案下载公案后到达这里的人,您需要从 https://github.com/edgecase/ruby_koans 现在。开始之前请务必运行rake gen

For those that got here after downloading the Koans from the renmendoza or neall versions of the koans, you'll want to get them from https://github.com/edgecase/ruby_koans now. Be sure to run rake gen before starting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文