0

我正在关注本教程,该教程涵盖了使用 rspec、capybara 等的 TDD。我在 Gemfile 中添加了以下内容:

group :test, :development do
    gem 'turn'
    gem 'rspec-rails'
    gem 'capybara'
    gem 'guard-rspec'
    gem 'growl_notify'
end

bundle install,现在得到:

juco@jucoiMac ~/Desktop/rails-test $ rails s
    gem install minitest
    /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn/minitest.rb:9:in `require': no such file to load -- minitest/unit (LoadError)
        from /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn/minitest.rb:9
        from /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn.rb:13:in `require'
        from /Library/Ruby/Gems/1.8/gems/turn-0.9.6/lib/turn.rb:13
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler/runtime.rb:68:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler/runtime.rb:68:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler/runtime.rb:66:in `each'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler/runtime.rb:66:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler/runtime.rb:55:in `each'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler/runtime.rb:55:in `require'
        from /Library/Ruby/Gems/1.8/gems/bundler-1.2.4/lib/bundler.rb:128:in `require'
        from /Users/juco/Desktop/rails-test/config/application.rb:7
        from /Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:53:in `require'
        from /Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:53
        from /Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
        from /Library/Ruby/Gems/1.8/gems/railties-3.2.12/lib/rails/commands.rb:50
        from script/rails:6:in `require'
        from script/rails:6

当我尝试执行任何 rails 命令时,包括rails server. 之前已经发过这个,但是没有回复。

4

2 回答 2

1

turngem 用于最小测试。似乎您正在使用 rspec,因此您遇到了不兼容问题。

于 2013-03-04T12:42:48.530 回答
1

转gem版本-

 group :test do
      gem 'turn', '< 0.8.3'
    end

来自:Minitest Error

于 2013-03-04T12:48:43.680 回答