小编use*_*203的帖子

ruby on rails语言问题"GBK中的无效字节序列"

这绝对是一个语言问题,我们的代码和数据库都包含中文字符.

****这是我的环境:

关于应用程序的环境Ruby版本1.9.1(i386-mingw32)RubyGems版本1.3.5 Rack版本1.0 Rails版本2.3.5 Active Record版本2.3.5 Active Resource版本2.3.5 Action Mailer版本2.3.5 Active Support版本2.3. 5应用程序根C:/ path_to_my_root环境开发数据库适配器mysql数据库架构版本20100327010640

****这是我的localhost; 3000运行我的ruby服务器之后:

ArgumentError in HomeController#construction

invalid byte sequence in GBK

RAILS_ROOT: C:/path_to_my_root
Application Trace | Framework Trace | Full Trace

C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template_error.rb:43:in `split'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template_error.rb:43:in `source_extract'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template_error.rb:86:in `compute_backtrace'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template_error.rb:11:in `initialize'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template.rb:212:in `new'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template.rb:212:in `rescue in render_template'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
template.rb:205:in `render_template'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
base.rb:265:in `render'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
base.rb:352:in `_render_with_layout'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/action_view/
base.rb:262:in `render'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/
action_controller/base.rb:1250:in `render_for_file'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/
action_controller/base.rb:951:in `render'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.5/lib/
action_controller/benchmarking.rb:51:in `block in
render_with_benchmark'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/
active_support/core_ext/benchmark.rb:17:in …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails

2
推荐指数
1
解决办法
1610
查看次数

标签 统计

ruby-on-rails ×1