2013-02-28 97 views
8

成功升級到Ruby 2.0.0的穩定版本(yay!)後,我決定繼續使用我的Koans 啓蒙之路。然而,在運行koans文件夾中的rake命令,當我通常做,我收到此錯誤:Ruby Koans與Ruby 2.0.0不兼容?

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批次的今天,爲好,以確保該WASN」我的問題。既不適合我! 1.9.3仍然運行良好。值得注意的是,我也通過RVM安裝了Ruby 2.0。在做之前,我確定要更新到最新的RVM。

什麼似乎是問題?

回答

14

有一個拉請求解決這個問題,但尚未接受:https://github.com/neo/ruby_koans/pull/84

現在,您可以在線編輯src/edgecase.rb 149爲:

in_ruby_version("1.9", "2.0") do 
+0

酷!這種情況在以後需要編輯嗎?換句話說,這會對其他應用程序造成任何問題嗎?我可以離開這個代碼,還是應該在Koans修復後立即更換它? – 2013-02-28 19:54:00

+0

這個改變直接針對Koans代碼,而不是一般的Ruby;它不會影響Koans之外的任何東西。當他們修復它時,您可以下載更新後的代碼並將其替換。 – 2013-02-28 19:56:28

+0

太棒了。很高興知道! – 2013-02-28 19:57:37