Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running rake test and Rails 'cannot load such file -- rails/performance_test_help

I am trying to run a rake test and I am unable to do it. I keep getting this error: ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" rake aborted! LoadError: cannot load such file -- rails/performance_test_help

I would greatly appreciate any insight.

like image 955
WNW Avatar asked Feb 14 '15 18:02

WNW


2 Answers

rails/performance_test_help is an old test helper that was used up to Rails 3.2 for performance testing. It was supposed to be required by performance test cases.

The file was remove in Rails 4 since the performance testing feature was extracted from Rails core and moved to the rails-perftest gem.

If you are using Rails 4, make sure the gem is listed in your Gemfile, and it's correctly installed. If you don't use the feature, simply drop the performance test cases.

To lookup the offending file, simply search your project codebase for any require 'rails/performance_test_help' statement, and either fix the issue or remove the offending file if you don't need the performance test case.

like image 126
Simone Carletti Avatar answered Nov 15 '22 05:11

Simone Carletti


run rake db:migrate RAILS_ENV=test before running rake test. Hope this solves your problem.

like image 24
sansarp Avatar answered Nov 15 '22 07:11

sansarp