我按照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测试会中止以及如何解决它?
谢谢。
答案 0 :(得分:0)
test-unit
安装gem install test-unit
gem