So you’re trying out the pre-release version of Rails 3.0 with Ruby 1.9 and you keep on getting the following error:
activesupport-3.0.pre/lib/active_support/inflector/transliterate.rb:2:in `require’: no such file to load – iconv (LoadError)
If you are using rvm to install and switch between different versions of ruby then follow the following steps:
- Install readline using rvm:
rvm install readlinervm package install readline - Now install iconv by executing:
rvm install iconvrvm package install iconv - if you already have a version of Ruby 1.9 installed, we need to remove it by executing: rvm remove 1.9.1/1.9.2
- The final step is to re-install the version of ruby: rvm install –trace 1.9.2 -C –with-iconv-dir=$HOME/.rvm/us
(If you are having problems with the command, use the pastie that Glenn Rempe posted in the comments. Thanks Glenn)
Now to test that it worked:
- Change to the ruby version you installed: rvm use 1.9.1/1.9.2
- Check you are on the right version of ruby: ruby -v #=> ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0]
- Start a new irb session
- Now you should be able to require ‘iconv’ and get a ‘true’ result
irb(main):001:0> require ‘iconv’
Now you should be good to go!
Advertisements