0

数据库:PostgreSQL 9.2

延迟作业 (3.0.5)

Delayed_job_active_record (0.4.4)

当我尝试运行 rake 任务时,rake 中止:

 "invalid byte sequence in UTF-8 (argument error)"

我不知道这是什么意思。

由于调试起来可能真的很困难,任何建议都得到了体现:可能我需要重新安装一些东西,尝试另一个 gem,或者任何东西。

提前致谢。

[Worker(host:HP-�� pid:4768)] Starting job worker
rake aborted!
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/trace_output.rb:16:in `block in trace_on': invalid byte sequence in UTF-8 (ArgumentError)
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/trace_output.rb:14:in `map'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/trace_output.rb:14:in `trace_on'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:328:in `trace'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:183:in `display_error_message'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:169:in `rescue in standard_exception_handling'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:159:in `standard_exception_handling'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
    from C:/Ruby193/bin/rake:23:in `load'
    from C:/Ruby193/bin/rake:23:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'
4

2 回答 2

2

Ruby 1.9.3,对吧?

在您的 Rakefile(以及任何具有非 ascii 字符的文件)的顶部,包括以下内容:

# encoding: utf-8
于 2013-04-30T23:56:50.470 回答
2

原因是这个 gem 设置了某种虚拟主机,并将其分配给您的 PC 名称。因此,如果它包含一些无效的拉丁库字符,则会导致错误。刚刚重命名了我的系统 - 工作正常。

于 2013-05-01T20:41:02.973 回答