坚持学习Ruby The Hard Way#46 rake aborted

时间:2015-09-16 19:53:33

标签: ruby rake learn-ruby-the-hard-way

我按照Learn Ruby The Hard Way #43中的描述制作了项目骨架,并创建了所述的结构。

当我运行rake test并且提示符出以下内容时,会出现问题:

/home/username/.rbenv/versions/2.2.2/bin/ruby -I"lib:tests"  "/home/username/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/test_NAME.rb" 
/home/username/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- test/unit (LoadError)
    from /home/username/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /mnt/30309D67309D34B6/Web Development/Tutorials/Ruby/projects/skeleton/tests/test_NAME.rb:2:in `<top (required)>'
    from /home/username/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/username/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/username/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb:15:in `block in <main>'
    from /home/username/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb:4:in `select'
    from /home/username/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:tests"  "/home/username/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/test_NAME.rb" ]

Tasks: TOP => test
(See full trace by running task with --trace)

有人可以告诉我为什么rake测试会中止以及如何解决它?

谢谢。

1 个答案:

答案 0 :(得分:0)

谢谢安东尼!你是金色的! 只需要使用test-unit

安装gem install test-unit gem