,當我剛剛通過我的應用程序在自己的生產環境:UTF-8麻煩Rails應用程序傳遞給生產
- 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和3.1.0鋼軌我 沒有視圖來顯示,因爲我使用的是DSL ActiveAdmin
我都試一下,但它不工作:( – Awea 2012-02-29 14:38:34
是線路122則標籤標記線?我認爲你對特殊的charakter>'<(apostroph)測試有問題,它會移除你的標籤。 – bulleric 2012-03-01 12:35:31
沒有這個字符的問題,只是一個與MySQL寶石fuc ***問題:) – Awea 2012-03-01 14:31:52