修正升級 redmine 後遇到 incompatible character encodings 問題

錯誤訊息長這樣
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"2639"}
  Current user: kiang (id=3)
  Rendered issues/_action_menu.html.erb (3.0ms)
  Rendered issues/show.html.erb within layouts/base (18.0ms)
Completed 500 Internal Server Error in 65.4ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8
BIT):
    78: 
    79:   <p><strong><%=l(:field_description)%></strong></p>
    80:   <div class="wiki">
    81:   <%= textilizable @issue, :description, :attachments => @issue.attachme
nts %>
    82:   </div>
    83: </div>
    84: <% end %>
  app/views/issues/show.html.erb:81:in `_app_views_issues_show_html_erb__4113277
02237453155_30359860'
  app/controllers/issues_controller.rb:128:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:125:in `show'

後來發現主要問題是舊有 mysql 驅動程式處理中文與英文交錯的內容造成,只要使用新的驅動程式就可以了。

在 Ubuntu 14.04 只要 apt-get install ruby-mysql2 ,然後把 /etc/redmine/default/database.yml 裡面的 mysql 改成 mysql2 即可

這個問題造成的災情不少
標籤:
Sign In or Register to comment.