views:

36

answers:

1

There is a module

require 'iconv'
module Escape

  def escape(string)
    return_value = Iconv.conv('ascii//translit//IGNORE', 'utf-8', string).to_s
  end
end

It`s work in 1.8.7 but not in 1.9.1

The error message is "NameError (uninitialized constant Escape::Iconv)"

and the follow is work in 1.9.1,Why??????? (my rails is rails 3 in ubuntu)

module Escape
  def escape(string)
    require 'iconv'
    return_value = Iconv.conv('ascii//translit//IGNORE', 'utf-8', string).to_s
  end
end
A: 

don't use 1.9.1 for rails3, instead use 1.9.2 or 1.8.7 . read here in the comments: http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release

apeacox
THX for your advise,I got that 1.9.1 and rails 3 are not friends.But I still want the reason very much
Zaac