Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby Koans not compatible with Ruby 2.0.0?

Tags:

ruby

rvm

ruby-2.0

After successfully upgrading to Ruby 2.0.0's stable release (yay!) I decided to continue on my Koans Path to Enlightenment. However, when running the rake command within the koans folder, as I normally do, I receive this error:

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

I also installed a fresh new Koans batch from GitHub today, as well, to assure that that wasn't my problem. Neither worked for me! It still runs great with 1.9.3. It may be worth noting that I also installed Ruby 2.0 via RVM. I made sure to update to the latest RVM before doing so.

What seems to be the problem?

like image 679
Jordan Thornquest Avatar asked Feb 28 '13 18:02

Jordan Thornquest


1 Answers

There is a pull request to fix this, but it has not been accepted yet: https://github.com/neo/ruby_koans/pull/84

For now, you can edit line 149 of src/edgecase.rb to be:

in_ruby_version("1.9", "2.0") do
like image 187
Dylan Markow Avatar answered Sep 30 '22 02:09

Dylan Markow