在我的模板(index.html.erb)中沒有任何代碼,比如utf-8或其他任何代碼。 因此,rails當然有一個問題。Rails和html - 編碼錯誤
Your template was not saved as valid UTF-8. Please either specify UTF-8 as the encoding for your template in your text editor, or mark the template with its encoding by inserting the following as the first line of the template:
# encoding: <name of correct encoding>.
,所以我試圖粘貼到我的html: # encoding: < meta charset=utf-8 />.
沒有我寫的東西錯了嗎?或者我可以採取任何其他的代碼?
從軌答案是:unknown encoding name - <
謝謝回答
是的,聽起來合乎邏輯,謝謝。 但是我可以把評論放在任何我想要的地方(在文檔的頂部,如書面或頭部),它仍然給我同樣的錯誤。無法解釋爲什麼... – Anna
您確定您以UTF8編碼保存模板文件嗎?你到底在模板文件中寫了什麼? – ckruse