Ruby on rails 测试从命令行运行,但未在RubyMine中运行-未找到任何测试

Ruby on rails 测试从命令行运行,但未在RubyMine中运行-未找到任何测试,ruby-on-rails,ruby,testing,rubymine,rake-test,Ruby On Rails,Ruby,Testing,Rubymine,Rake Test,我正在尝试使用RubyMine在现有项目中运行测试。不幸的是,每当我尝试这样做时,我都会收到消息未找到任何测试,并且在测试控制台输出的底部我会看到消息: Errors running test:units and test:functionals! Empty test suite. Process finished with exit code 1 从命令行运行与从RubyMine内部运行有什么区别?看起来这可能与RubyMine设置的环境(C:/CodeMetrics/2nd/cmusv/

我正在尝试使用RubyMine在现有项目中运行测试。不幸的是,每当我尝试这样做时,我都会收到消息未找到任何测试,并且在测试控制台输出的底部我会看到消息:

Errors running test:units and test:functionals! Empty test suite. Process finished with exit code 1
从命令行运行与从RubyMine内部运行有什么区别?

看起来这可能与RubyMine设置的环境(C:/CodeMetrics/2nd/cmusv/)以及最新测试单元gem与Rails 2.x的不兼容性有关。如果您没有指定要安装的gem版本,那么可能就是罪魁祸首()


尝试将项目配置中的测试单元gem恢复到1.2.3。

对我有效的方法是删除环境变量
“RAILS\u ENV=test”
。从那以后一切都很好

RubyMine v-3.2.4和v-4.0Beta RM-112.49

Ruby 1.9.3和Ruby 1.9.2

C:\Ruby187\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby187\bin/rake test Testing started at 1:41 PM ... (in C:/CodeMetrics/2nd/cmusv) C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/course_number_test.rb" "test/unit/course_test.rb" "test/unit/curriculum_comment_test.rb" "test/unit/curriculum_comment_type_test.rb" "test/unit/effort_log_line_item_test.rb" "test/unit/effort_log_mailer_test.rb" "test/unit/effort_log_template_test.rb" "test/unit/effort_log_test.rb" "test/unit/google_apps_test.rb" "test/unit/page_test.rb" "test/unit/paper_test.rb" "test/unit/person_test.rb" "test/unit/project_test.rb" "test/unit/project_type_test.rb" "test/unit/rss_feed_test.rb" "test/unit/scotty_dog_saying_test.rb" "test/unit/task_type_test.rb" "test/unit/team_test.rb" "test/unit/time_machine_test.rb" "test/unit/user_test.rb" C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError) from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `rake_original_const_missing' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing' from C:/Ruby187/lib/ruby/gems/1.8/gems/test-unit-1.2.3/lib/test/unit/autorunner.rb:47 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:\Program Files (x86)\JetBrains\RubyMine 97.39/rb/testing\patch\testunit/test/unit/autorunner.rb:24 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/test-unit-2.1.1/lib/test/unit.rb:2 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/test_unit.rb:1 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda.rb:8 from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require' from C:/CodeMetrics/2nd/cmusv/config/boot.rb:43:in `load_gems' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from C:/CodeMetrics/2nd/cmusv/config/environment.rb:17 from ./test/test_helper.rb:2:in `require' from ./test/test_helper.rb:2 from ./test/unit/course_number_test.rb:1:in `require' from ./test/unit/course_number_test.rb:1 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/courses_controller_test.rb" "test/functional/course_numbers_controller_test.rb" "test/functional/curriculum_comments_controller_test.rb" "test/functional/curriculum_comment_types_controller_test.rb" "test/functional/effort_logs_controller_test.rb" "test/functional/effort_log_line_items_controller_test.rb" "test/functional/effort_reports_controller_test.rb" "test/functional/mailing_lists_controller_test.rb" "test/functional/pages_controller_test.rb" "test/functional/papers_controller_test.rb" "test/functional/people_controller_test.rb" "test/functional/projects_controller_test.rb" "test/functional/project_types_controller_test.rb" "test/functional/rss_feeds_controller_test.rb" "test/functional/scotty_dog_sayings_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/system_controller_test.rb" "test/functional/task_types_controller_test.rb" "test/functional/teams_controller_test.rb" "test/functional/users_controller_test.rb" "test/functional/welcome_controller_test.rb" C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError) from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `rake_original_const_missing' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing' from C:/Ruby187/lib/ruby/gems/1.8/gems/test-unit-1.2.3/lib/test/unit/autorunner.rb:47 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:\Program Files (x86)\JetBrains\RubyMine 97.39/rb/testing\patch\testunit/test/unit/autorunner.rb:24 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/test-unit-2.1.1/lib/test/unit.rb:2 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/test_unit.rb:1 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda.rb:8 from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require' from C:/CodeMetrics/2nd/cmusv/config/boot.rb:43:in `load_gems' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from C:/CodeMetrics/2nd/cmusv/config/environment.rb:17 from ./test/test_helper.rb:2:in `require' from ./test/test_helper.rb:2 from ./test/functional/courses_controller_test.rb:1:in `require' from ./test/functional/courses_controller_test.rb:1 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" Errors running test:units and test:functionals! Empty test suite. Process finished with exit code 1