0

我在 CentOS 5.6 中使用 Rails 3.2.13 和 ruby​​ 1.9.2p320 (2012-04-20 修订版 35421) [x86_64-linux]。当我运行 db:seed 进程时,我收到以下错误消息

rake aborted!
invalid byte sequence in UTF-8
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/core_ext/object/blank.rb:105:in `=~'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/core_ext/object/blank.rb:105:in `!~'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/core_ext/object/blank.rb:105:in `blank?'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activemodel-3.2.13/lib/active_model/errors.rb:255:in `block in add_on_blank'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activemodel-3.2.13/lib/active_model/errors.rb:253:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activemodel-3.2.13/lib/active_model/errors.rb:253:in `add_on_blank'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activemodel-3.2.13/lib/active_model/validations/presence.rb:8:in `validate'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:310:in `_callback_before_2997'
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:407:in `_run__3451238938034873984__validate__3894789870199871463__callbacks'

blank.rb 行号:105 包含 self !~ /[^[:space:]]/. 我试过# encoding: utf-8了,但它从来没有解决问题。解决此问题的任何其他解决方案...

4

0 回答 0