Rails控制台无法正常工作

时间:2015-01-04 14:25:21

标签: ruby-on-rails ruby ruby-on-rails-3 unit-testing

尝试发出rails c命令时出现以下错误。我已经关注了其他问题的建议并卸载了minitest v5并重新安装到v4但没有修复。有没有人知道如何绕过它?感谢。

 MiniTest::Unit::TestCase is now Minitest::Test. From /usr/lib/ruby/1.9.1/test/unit/testcase.rb:8:in `<module:Unit>'
/usr/lib/ruby/1.9.1/test/unit.rb:328:in `autorun': uninitialized class variable @@installed_at_exit in Test::Unit::Runner (NameError)
    from /usr/lib/ruby/1.9.1/test/unit.rb:640:in `<top (required)>'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `block in require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
    from /usr/lib/ruby/vendor_ruby/active_support/test_case.rb:2:in `<top (required)>'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `block in require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
    from /usr/lib/ruby/vendor_ruby/rails/console/app.rb:2:in `<top (required)>'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `block in require'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in `require'
    from /usr/lib/ruby/vendor_ruby/rails/application.rb:312:in `initialize_console'
    from /usr/lib/ruby/vendor_ruby/rails/application.rb:152:in `load_console'
    from /usr/lib/ruby/vendor_ruby/rails/commands/console.rb:27:in `start'
    from /usr/lib/ruby/vendor_ruby/rails/commands/console.rb:8:in `start'
    from /usr/lib/ruby/vendor_ruby/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

1 个答案:

答案 0 :(得分:2)

我明白了。

您必须将test-unit gem添加到gemfile:gem 'test-unit'bundle install(如果它是rails3)。