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

后端 未结 2 1235
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 09:41
    ➜  expertiza git:(master) ✗ ruby -v
    ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.1.0]
    ➜  expertiza git:(master) ✗ rails -v
    Rails 2.3.14
             


        
相关标签:
2条回答
  • 2020-12-06 10:37

    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)

    0 讨论(0)
  • 2020-12-06 10:38

    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

    0 讨论(0)
提交回复
热议问题