设置 Ruby Koans
这个问题可能非常愚蠢/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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试从 http://rubykoans.com/ 安装 koans
他们有详细的安装说明和故障排除部分。
如果由于某种原因仍然无法正常工作,那么您应该向以前做过此操作的现实程序员朋友寻求帮助:)
旧答案:
请尝试运行“path_to_enlightenment.txt”。 “koans”目录中的“rb”文件。
那不使用耙子。如果这不起作用,那么您的 ruby 安装可能已损坏。
“path_to_enlightenment”的第一行是:
这使得“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.
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:
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.
如果尚未安装自动测试,您需要执行
gem install 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.
对于那些从
renmendoza
或neall
版本的公案下载公案后到达这里的人,您需要从 https://github.com/edgecase/ruby_koans 现在。开始之前请务必运行rake gen
。For those that got here after downloading the Koans from the
renmendoza
orneall
versions of the koans, you'll want to get them from https://github.com/edgecase/ruby_koans now. Be sure to runrake gen
before starting.