错误“不知道如何构建任务 'konacha:serve'

error 'Don't know how to build task 'konacha:serve'

我已按照 https://www.botreetechnologies.com/blog/test-rails-app-using-mocha-js-chai-js 中的步骤设置 konacha。

我在spec/javascripts文件夹中写了一个简单的hello world测试如下:

var assert = require('assert');
describe('HelloWorld Module', function() {
  it('should return -1 when "Hello" is missing', function() {
    assert.equal(-1, "Hallo World".indexOf("Hello"));
  });
  it('should return 0 when sentence starts with Hello', function() {
    assert.equal(0, "Hello World, how are you?".indexOf("Hello"));
  });
});

当我 运行 $bundle exec rake konacha:run --trace 时,出现以下错误:

rake aborted!
Don't know how to build task 'konacha:run' (see --tasks)
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/task_manager.rb:71:in `[]'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:151:in `invoke_task'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `each'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:108:in `block in top_level'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:117:in `run_with_threads'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:102:in `top_level'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:80:in `block in run'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:178:in `standard_exception_handling'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/lib/rake/application.rb:77:in `run'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/home/vagrant/.rbenv/versions/2.2.10/bin/rake:23:in `load'
/home/vagrant/.rbenv/versions/2.2.10/bin/rake:23:in `<top (required)>'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:74:in `load'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/cli/exec.rb:28:in `run'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/cli.rb:463:in `exec'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/cli.rb:27:in `dispatch'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/cli.rb:18:in `start'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/exe/bundle:30:in `block in <top (required)>'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/vagrant/.rbenv/versions/2.2.10/lib/ruby/gems/2.2.0/gems/bundler-1.17.1/exe/bundle:22:in `<top (required)>'
/home/vagrant/.rbenv/versions/2.2.10/bin/bundle:23:in `load'
/home/vagrant/.rbenv/versions/2.2.10/bin/bundle:23:in `<main>'

有人可以帮我解决这个问题吗?

我不仅要将 gem 包含在 gem 文件的 :test 组中,还要包含在 :development 组中。在那之后它似乎起作用了。