我试图将一些旧的rails应用程序移植到
Ruby 1.9,我不断收到关于
Ruby 1.9如何不支持Unicode标准化的警告.我已经跟踪到这个功能,但是我每个请求收到大约20个警告消息:
导轨-2.3.5 /的ActiveSupport / lib中/ active_support / inflector.rb
- def transliterate(string)
- warn "Ruby 1.9 doesn't support Unicode normalization yet"
- string.dup
- end
任何想法我应该如何开始跟踪这些下来并解决它?
解决方法
如果您知道后果,即重音字符不会在Ruby 1.9.1 Rails 2.3.x中进行音译,请将其放在配置/初始化器中以使警告静音:
- # https://stackoverflow.com/questions/2135247/ruby-1-9-doesnt-support-unicode-normalization-yet
- module ActiveSupport
- module Inflector
- # Calling String#parameterize prints a warning under Ruby 1.9,# even if the data in the string doesn't need transliterating.
- if Rails.version =~ /^2\.3/
- undef_method :transliterate
- def transliterate(string)
- string.dup
- end
- end
- end
- end