成功升级到Ruby 2.0.0的稳定版本之后(耶!)我决定继续我的Koans 启蒙之路。但是,当我像往常一样在koans文件夹中运行rake
命令时,我收到此错误:
rake
cd koans
/Users/jordanthornquest/.rvm/rubies/ruby-2.0.0-p0/bin/ruby path_to_enlightenment.rb
/Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:399:in `rescue in meditate': uninitialized constant EdgeCase::Sensei::AssertionError (NameError)
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:407:in `meditate'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:470:in `block in walk'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:481:in `block (3 levels) in each_step'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:479:in `each'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:479:in `block (2 levels) in each_step'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:478:in `each'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:478:in `each_with_index'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:478:in `block in each_step'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:476:in `catch'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:476:in `each_step'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:469:in `walk'
from /Users/jordanthornquest/programming/ruby-koans/koans/edgecase.rb:491:in `block in <top (required)>'
rake aborted!
Command failed with status (1): [/Users/jordanthornquest/.rvm/rubies/ruby-2...]
/Users/jordanthornquest/programming/ruby-koans/Rakefile:90:in `block in <top (required)>'
/Users/jordanthornquest/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
/Users/jordanthornquest/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => default => walk_the_path
我今天也从GitHub安装了一个全新的Koans批次,以确保这不是我的问题。对我来说都没有用! 1.9.3仍然运行良好。值得注意的是,我还通过RVM安装了Ruby 2.0。我确保在这之前更新到最新的RVM。
什么似乎是问题?
答案 0 :(得分:14)
有一个拉取请求要解决此问题,但尚未接受:https://github.com/neo/ruby_koans/pull/84
目前,您可以将src/edgecase.rb
的第149行编辑为:
in_ruby_version("1.9", "2.0") do