运行rake时出现未知编码错误

时间:2011-03-14 14:41:00

标签: ruby-on-rails rake

我一直在编写一个Rails应用程序,现在才开始使用它 测试覆盖率。我写了一个基本测试,当我执行时 命令提示符下的'rake'命令,我收到以下错误:

E:\testapp>rake 
(in E:/testapp) 
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib 
(RuntimeError) 
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib 
(RuntimeError) 
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib 
(RuntimeError) 
Errors running test:units, test:functionals, test:integration!

当我运行rake test:units时,我得

E:\testapp>rake test:units 
(in E:/testapp) 
E:/Ruby192/bin/ruby.exe: unknown encoding name - \Ruby192\lib 
(RuntimeError) 
rake aborted! 
Command failed with status (1): [E:/Ruby192/bin/ruby.exe -I"lib;test" 
"E:/R...] 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:993:in `block in sh' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1008:in `call' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1008:in `sh' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1092:in `sh' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1027:in `ruby' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1092:in `ruby' 
E:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/test_unit/testing.rake:26:in `block (2 levels) in define' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1110:in `verbose' 
E:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/test_unit/testing.rake:11:in `block in define' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block ininvoke_with_call_chain' 
E:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) intop_level' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in`standard_exception_handling' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level' 
E:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run' 
E:/Ruby192/bin/rake:31:in `<main>' 

我试过在网上搜索没有成功..我最初假设 我的测试代码出了问题,但我得到了同样的错误 一个新的rails应用!!

我在Windows Vista上的Ruby 1.9.2p180上使用Rails 3.0.5。根据朋友的建议,我 安装了RubyInstaller并使用了DevKit,但我仍然保持不变 错误。

任何输入?

1 个答案:

答案 0 :(得分:0)

看看路径,你似乎指的是ruby 1.9.1

E:/ Ruby192 / LIB /红宝石/的 1.9.1 /rake.rb

我不熟悉Windows,但必须指出旧的Ruby版本