Rails控制台无法使用redgreen gem

时间:2012-06-25 14:13:51

标签: ruby-on-rails-3 rails-console redgreen

我在使用rails控制台时遇到问题,这是我尝试启动rails控制台时的问题:

  

backo @ speedy:〜/ ucimrails / simple_app $ rails c --sandbox   /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in require': no such file to load -- test/unit/ui/console/testrunner (LoadError) from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in阻止在'require'中     来自/home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in load_dependency' from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in require'     来自/home/backo/.rvm/gems/ruby-1.9.2-p320/gems/redgreen-1.2.2/lib/redgreen.rb:2:in <top (required)>' from /home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in require'     来自/home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in block (2 levels) in require' from /home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in每个'     来自/home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in block in require' from /home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in每个'     来自/home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in require' from /home/backo/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler.rb:119:in require'     来自/home/backo/ucimrails/simple_app/config/application.rb:13:in <top (required)>' from /home/backo/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:39:in require'     来自/home/backo/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:39:in <top (required)>' from script/rails:6:in require'     来自script / rails:6:in''

我发现问题是由redgreen gem引起的。当我从Gemfile中排除它时,控制台再次工作。但是,有人可以帮助我使用redgreen gem吗?有趣的是,这只发生在我的netbok上,当我在我的桌面计算机上工作时,使用rails console一切都很好。

2 个答案:

答案 0 :(得分:2)

在我的Gemfile中指定:

gem 'test-unit', '1.2.3'

...似乎对我有用1.9.3和Rails 3.2.8。然而,将它与更新版本的测试单元一起使用会很好(看起来2.5.2是最新版本)...

答案 1 :(得分:0)

redgreen gem不适用于1.9.2;对于redgreen测试输出,您可以尝试

require 'test/unit'
require 'test/unit/ui/console/testrunner'   

class Test::Unit::UI::Console::TestRunner
  def guess_color_availability; true; end
end

在你的测试助手左右。