0

I'm running a Ruby on Rails 2.3.18 application on Ruby 2.1.5p273 and when I run the Unit tests suite I get this output in terminal

dminca@dev:$ bundle exec rake test:units                                                                                                                                                                                                                           
* ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
* /home/dminca/.rvm/gems/ruby-2.1.5/bin/rake
* pid: 32205
* Using RAILS_ENV for ENV_CONFIG: development
* configuring for environment: development
* loaded .env .env.development
* configuring LOGGING: file
  LOG_FILE: development.log
  LOG_PATH: log
  LOG_FILE_PATH: /home/dminca/Projects/mld/application/log/development.log
  LOG_LEVEL: debug
* configuring TRACKER: Utility::Tracker::Stdout
/home/dminca/.rvm/rubies/ruby-2.1.5/bin/ruby -I"lib:test" -I"/home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib" "/home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb" "test/unit/**/*_test.rb" 
/home/dminca/Projects/mld/application/test/unit/helpers/cms/app_texts_helper_test.rb:1:in `require': cannot load such file -- test_helper (LoadError)
        from /home/dminca/Projects/mld/application/test/unit/helpers/cms/app_texts_helper_test.rb:1:in `<top (required)>'
        from /home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:10:in `require'
        from /home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
        from /home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:9:in `each'
        from /home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:9:in `block in <main>'
        from /home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:4:in `select'
        from /home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:test" -I"/home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib" "/home/dminca/.rvm/gems/ruby-2.1.5/gems/rake-0.9.6/lib/rake/rake_test_loader.rb" "test/unit/**/*_test.rb" ]
/home/dminca/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/home/dminca/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test:units
(See full trace by running task with --trace)

How can I make the tests work?

Daniel Andrei Mincă
  • 4,446
  • 2
  • 19
  • 30
  • Rails 3.0 was released August 2010. Rails 5.0 will be released soon. Rails 2.3 got its last security update more about three years ago (That is longer ago than the last security patch for Windows XP). Did you consider updating? – spickermann Feb 04 '16 at 13:50
  • Yes, I've considered upgrading but the application has been developed massively since 2010 and it's huge and it doesn't have any written tests to help in the process of upgrading. I want to make the test suite work first, and then I can consider upgrading to a higher version. – Daniel Andrei Mincă Feb 04 '16 at 13:53
  • I suggest to get it work on Ruby 1.8.7 first, before trying to run Rails 2.3 on Ruby 2.x version. See [Ruby/Rails Compatibility Matrix](http://www.devalot.com/articles/2012/03/ror-compatibility) and the answers to this [question](https://stackoverflow.com/questions/9087116/which-ruby-on-rails-is-compatible-with-which-ruby-version). – spickermann Feb 04 '16 at 14:07
  • The application runs ok on Ruby 2.1.5, there's no compatibility problem. A minor fix has been applied for it to work properly on this version. – Daniel Andrei Mincă Feb 04 '16 at 14:19

0 Answers0