Iconv is a library used for charset conversion.
Ruby’s Iconv is a wrapper class for the UNIX 95 iconv() function family, which translates string between various encoding systems.
See Open Group’s on-line documents for more details.
There were some iconv related Rails 0.11 Upgrade Problems.
Iconv is required by the SaltedHashLoginGenerator(due to a dependency on "Localization").
Iconv works out-of-the-box with the latest One-Click Installer (version 1.8.4).
Ruby needs two components for require 'iconv' to work: iconv.so, which is the ruby part, and iconv.dll, which is the iconv library proper. These are missing from One-Click Installer versions 1.8.2 and earlier.
Here is an iconv package with simple installation instructions , which includes both of those components, works with the One-Click Installer 1.8.0-1.8.2, and solves both of the problems detailed below.
Depending on which Ruby distribution you have installed, the iconv ruby extension may not be installed (see if you have ruby\lib\ruby\1.8\i386-mswin32\iconv.so).
The Ruby-mswin32 distribution contains the required files.
Inside the zip, the path to the file is: lib/ruby/1.8/i386-mswin32/iconv.so
If requiring iconv fails complaining about how “iconv.dll was not found”, such as:
rb(main):001:0> require 'iconv'
produces:
![]()
LoadError: 126: The specified module could not be found. - d:/ruby/lib/ruby/1.8/i386-mswin32/iconv.so
from d:/ruby/lib/ruby/1.8/i386-mswin32/iconv.so
from d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'
from (irb):1
Iconv.dll can be acquired from a number of sources. It is available as a separate download from the gettext for win32 project on SourceForge.
for mingw download the port and (I believe the dev) ports, and build your .so through some means (see http://wiki.rubyonrails.org/rails/pages/Win32MingwInstall).
bin/iconv.dll to Windows\system32 (or somewhere else on your path, such as \ruby\bin\)When running the rake command, you may come across the following error (I did):
No such file to load — iconv
Assuming you have already installed ruby (1.8.6). Check to see if /lib/ruby/1.8/i386-cygwin/iconv.so exists. If not, the easiest way to get it is to download the ruby source, compile it, then copy the file into place.
Using the Cygwin setup.exe tool, install the following packages:
Do not deselect any dependencies that are automatically selected when choosing the above items.
If you have not installed them already, you will also need to install various build tools like ‘gcc’ and ‘make’ in order to compile the binding from source.
After the packages have been installed, open a command prompt and type the following, replacing <version> with the actual version that you installed:
cd /usr/src/ruby-
./configure
make
cp .ext/i386-cygwin/iconv.so /lib/ruby/1.8/i386-cygwin/.