in `require': no such file to load — iconv (LoadError)

北慕城南 提交于 2019-11-27 23:33:13
fantaxy025025

It shows that the iconv not exist but the iconv has installed in my production env.

root@AY130/current# iconv --version
iconv (Ubuntu EGLIBC 2.15-0ubuntu10.4) 2.15
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Ulrich Drepper.

To resolve it, add this in your Gemfile:

gem "iconv", "~> 1.0.3"

Then run bundle install.

Note: iconv has been deprecated for a while. It is replaced by (builtin) String#encode
See here: https://bbs.archlinux.org/viewtopic.php?id=160369

For those using rbenv instead of rvm

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

Then use the directory location of iconv to reinstall ruby

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

Good luck

(As a side note, this error has been reported to happen in Ruby 1.8.7-p3xx)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!