测试 执行 rake spec --trace 出现的问题

whitecrow · 2012年05月09日 · 最后由 whitecrow 回复于 2012年05月10日 · 4001 次阅读

Gemfile: group :test, :development do gem 'rspec-rails', '~>2.10.0' gem "cucumber-rails", ">= 0.3.2" gem 'watchr' gem 'spork' #gem 'rack-rewrite', '~> 1.0.2' end

/spec/controllers/bookings_controller_spec: require 'spec_helper'

describe BookingsController do describe "POST create" do it "creates a new message" it "saves the message" end end

错误信息:

rake spec --trace ** Invoke spec (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:abort_if_pending_migrations ** Execute db:test:prepare ** Invoke db:test:load (first_time) ** Invoke db:test:purge (first_time) ** Invoke environment ** Execute db:test:purge ** Execute db:test:load ** Invoke db:test:load_schema (first_time) ** Invoke db:test:purge ** Execute db:test:load_schema ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load ** Execute spec /home/liush/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/controllers/bookings_controller_spec.rb /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:317:in rescue in depend_on': No such file to load -- /home/liush/source/rails_test/langleycms/app/mailers/refinery/blog/comment_mailer (LoadError) from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:312:independ_on' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:225:in require_dependency' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/engine.rb:439:inblock (2 levels) in eager_load!' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/engine.rb:438:in each' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/engine.rb:438:inblock in eager_load!' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/engine.rb:436:in each' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/engine.rb:436:ineager_load!' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/application/railties.rb:8:in each' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/application/railties.rb:8:inall' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/engine.rb:434:in eager_load!' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/application/finisher.rb:53:inblock in module:Finisher' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/initializable.rb:30:in instance_exec' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/initializable.rb:30:inrun' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/initializable.rb:55:in block in run_initializers' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/initializable.rb:54:ineach' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/initializable.rb:54:in run_initializers' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/application.rb:136:ininitialize!' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in method_missing' from /home/liush/source/rails_test/langleycms/config/environment.rb:5:in' from /home/liush/source/rails_test/langleycms/spec/spec_helper.rb:3:in require' from /home/liush/source/rails_test/langleycms/spec/spec_helper.rb:3:in' from /home/liush/source/rails_test/langleycms/spec/controllers/bookings_controller_spec.rb:1:in require' from /home/liush/source/rails_test/langleycms/spec/controllers/bookings_controller_spec.rb:1:in' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/configuration.rb:746:in load' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/configuration.rb:746:inblock in load_spec_files' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/configuration.rb:746:in map' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/configuration.rb:746:inload_spec_files' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/command_line.rb:22:in run' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/runner.rb:69:inrun' from /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/runner.rb:10:in block in autorun' rake aborted! /home/liush/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/controllers/bookings_controller_spec.rb failed /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/rake_task.rb:137:inblock (2 levels) in initialize' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:60:in verbose' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rspec-core-2.10.0/lib/rspec/core/rake_task.rb:127:inblock in initialize' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:205:in call' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:200:in each' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecute' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:158:in block in invoke_with_call_chain' /home/liush/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:inmon_synchronize' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:151:in invoke_with_call_chain' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:116:in invoke_task' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:94:in each' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:66:in block in run' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/lib/rake/application.rb:63:in run' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/gems/rake-0.9.2.2/bin/rake:33:in' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/bin/rake:19:in load' /home/liush/.rvm/gems/ruby-1.9.3-p125@one_blog/bin/rake:19:in

' Tasks: TOP => spec

请问怎么解决呀~~

需要 登录 后方可回复, 如果你还没有账号请 注册新账号