【发布时间】:2012-03-18 21:46:21
【问题描述】:
我刚刚在他的生产环境中通过了我的应用程序:
- debian
- nginx
- 独角兽
- mysql
在开发中我使用:
- mac osx 10.7.3
- webrick
- sqlite
当我转到带有一些 UTF-8 字符的视图时出现错误:
ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
1: render renderer_for(:new)
app/admin/projects.rb:122:in `block (2 levels) in <top (required)>'
我已经在我的文件顶部添加了这个:
# encoding: utf-8
它可以在我的开发环境中工作,但不能在我的生产环境中工作,有什么想法吗?
编辑
错误来自这里:
f.has_many :roles do |app_f|
app_f.inputs do
# if object has id we can destroy it
if app_f.object.id
app_f.input :_destroy, :as => :boolean, :label => "Supprimer l'utilisateur du projet"
end
app_f.input :user, :include_blank => false, :label_method => :to_label
app_f.input :role_name, :include_blank => false
#app_f.input :role_level, :label => 'Author type', :as => :select, :include_blank => false, :collection => Role::role_list
end
end
如果我更改当前语言环境,它不会改变任何东西。
编辑
我正在使用 ruby 1.9.3 和 rails 3.1.0 我没有要显示的视图,因为我使用的是ActiveAdmin DSL
【问题讨论】:
标签: ruby-on-rails utf-8 activeadmin