anny_goerl
anny_goerl

Reputation: 642

rails 3.2 ruby 1.8.7 iconv (LoadError)

I am getting an akward error using rails 3.2.3 and ruby 1.8.7-p334 or p358. I unfortunatly must use 1.8.7 since the webhoster i am deploying to is using 1.8.7 patchlevel 334. I and and collegue have no problem running that on Mint or on my Macbook Pro with Xcode 4.2.1 But I can do a rails server or console on my imac

I tried downgrading from 4.3.2 xcode to 4.1 but no effect. Neither with installing readline in rvm or on system. I also tried package install iconv on rvm. Maybe anyone knows a solution for this?

Here's my error: /ruby-1.8.7-p334@porject/gems/json-1.6.6/lib/json/common.rb:407:in `require': no such file to load -- iconv (LoadError)

Upvotes: 0

Views: 1203

Answers (3)

Konstantine Kalbazov
Konstantine Kalbazov

Reputation: 2673

If you are using RVM try $ rvm reinstall 1.8.7 -C --with-iconv-dir=/usr/local.

Upvotes: 0

jassa
jassa

Reputation: 20191

I got the same error on Ruby 1.8.7-p358

I'm using rbenv instead of rvm

You have to specify the directory of iconv when installing ruby

$ which iconv
$ /usr/local/bin/iconv

So you'd have to do something like this:

$ CONFIGURE_OPTS="--with-iconv-dir=/usr/local" rbenv install 1.8.7-p358

Note that you are specifying the directory location, not the binary’s

I wrote a blog post about it

Upvotes: 1

anny_goerl
anny_goerl

Reputation: 642

Ok, fixed the problem with that what I found on the RVM page this morning:

http://beginrescueend.com/packages/iconv/

Of course, I changed 1.9.2 to 1.8.7.

Upvotes: 1

Related Questions