简体   繁体   中英

Delayed Jobs: can't run rake jobs:work

Database:PostgreSQL 9.2

Delayed_job (3.0.5)

Delayed_job_active_record (0.4.4)

When I try to run rake task, rake aborted with:

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

I have no idea what does it mean.

As it probably really hard to debug, any advices appresiated: may be I need to reinstall something, try another gem, or anything.

Thanks in advance.

[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>'

Ruby 1.9.3, right?

On the top of your Rakefile (and any file with non-ascii characters), include the following:

# encoding: utf-8

The reason is that this gem sets up some kind of virtual hosting, and assigns it to name of your PC. So if it contains some invalid for latin library character, it causes error. Just renamed my system - works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM