Localization 访问管理/设置时出现内部错误(UTF-8中的字节序列无效)
Localization 访问管理/设置时出现内部错误(UTF-8中的字节序列无效),localization,jruby,redmine,strftime,Localization,Jruby,Redmine,Strftime,我的配置: Ruby implementation: jruby 1.7.5 (1.9.3p392) 2013-10-07 74e9291 on Java HotSpot(TM) Client VM 1.7.0_25-b16 [Windows Server 2008 R2-x86] Operating system: Microsoft Windows Server 2008 R2 [Version 6.1.7601] Database: PostgreSQL 9.3 Server:
我的配置:
Ruby implementation:
jruby 1.7.5 (1.9.3p392) 2013-10-07 74e9291 on Java HotSpot(TM) Client VM 1.7.0_25-b16 [Windows Server 2008 R2-x86]
Operating system:
Microsoft Windows Server 2008 R2 [Version 6.1.7601]
Database:
PostgreSQL 9.3
Server:
Webrick
Environment:
Redmine version 2.3.3.stable
Ruby version 1.9.3-p392 (2013-10-07) [java]
Rails version 3.2.13
Environment production
Database adapter PostgreSQL
Redmine plugins:
no plugin installed
当我尝试使用俄语翻译访问管理->设置时,我遇到内部错误:
ActionView::Template::Error (invalid byte sequence in UTF-8):
7:
8: <p><%= setting_select :start_of_week, [[day_name(1),'1'], [day_name(6),'6'], [day_name(7),'7']], :blank => :label_language_based ></p>
9: < locale = User.current.language.blank? ? ::I18n.locale : User.current.language %>
10: <p><%= setting_select :date_format, Setting::DATE_FORMATS.collect {|f| [::I18n.l(Date.today, :locale => locale, :format => f), f]}, :blank => :label_language_based %></p>
11:
12: <p><%= setting_select :time_format, Setting::TIME_FORMATS.collect {|f| [::I18n.l(Time.now, :locale => locale, :format => f), f]}, :blank => :label_language_based %></p>
13:
app/helpers/settings_helper.rb:38:in `setting_select'
app/views/settings/_display.html.erb:10:in `_app_views_settings__display_html_erb__912948922_14104'
app/views/settings/_display.html.erb:1:in `_app_views_settings__display_html_erb__912948922_14104'
app/views/common/_tabs.html.erb:24:in `_app_views_common__tabs_html_erb__398022901_13972'
app/views/common/_tabs.html.erb:23:in `_app_views_common__tabs_html_erb__398022901_13972'
app/helpers/application_helper.rb:271:in `render_tabs'
app/views/settings/edit.html.erb:3:in `_app_views_settings_edit_html_erb___540221663_13968'
app/controllers/settings_controller.rb:28:in `index'
ActionView::Template::Error(UTF-8中的字节序列无效):
7:
8::基于语言的标签>
9:
10:locale,:format=>f),f]},:blank=>:label\u language\u-based%>
11:
12:locale,:format=>f),f]},:blank=>:label\u language\u-based%>
13:
app/helpers/settings\u helper.rb:38:in'setting\u select'
app/views/settings/\u display.html.erb:10:在`\u app\u views\u settings\u display\u html\u erb\u 912948922\u 14104'中
app/views/settings/\u display.html.erb:1:在`\u app\u views\u settings\u display\u html\u erb\u 912948922\u 14104'中
app/views/common/_tabs.html.erb:24:in``_app\u views\u common\u tabs\u html\u erb\u 398022901\u 13972'
app/views/common/_tabs.html.erb:23:in``应用程序视图`公共标签` html\u erb\u398022901\u13972'
app/helpers/application\u helper.rb:271:在“渲染”选项卡中
app/views/settings/edit.html.erb:3:in`_app\u views\u settings\u edit\u html\u erb\u 540221663\u 13968'
app/controllers/settings\u controller.rb:28:in'index'
如果我在config/locales/ru.yml month_name中用“十月”替换“十月”,并用“上午”替换“上午”,那么一切都会顺利进行。
请帮助我以正确的方式解决此问题。谢谢你的帮助
PS:抱歉我的英语不好:)问题在于jruby strftime:它在格式字符串中打断unicode字符。。。用jruby 1.7.6版本修复。我用chmod 0777 tmp/cache解决了这个问题