在“需要"中:没有要加载的此类文件- iconv (LoadError) [英] in `require': no such file to load -- iconv (LoadError)

查看:17
本文介绍了在“需要"中:没有要加载的此类文件- iconv (LoadError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    ➜  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
    ➜  expertiza git:(master) ✗ script/server
/Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in `require': no such file to load -- iconv (LoadError)
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext/integer/inflections.rb:1:in `require'
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext/integer/inflections.rb:1
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext/integer.rb:2:in `require'
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext/integer.rb:2
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext.rb:8:in `require'
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext.rb:8
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext.rb:8:in `each'
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/core_ext.rb:8
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support.rb:56:in `require'
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support.rb:56
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/rails-2.3.14/lib/commands/server.rb:1:in `require'
    from /Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/rails-2.3.14/lib/commands/server.rb:1
    from script/server:3:in `require'

我试过安装

rvm pkg install readline
rvm pkg install iconv
rvm install 1.8.7
rvm use 1.8.7 

即使尝试过 为什么在 Mac OS 上安装 Nokogiri 会失败,并且缺少 libiconv?.

没有任何效果.请帮忙!

Nothing works. Please help!

谢谢!

推荐答案

它显示 iconv 不存在但 iconv 已安装在我的生产环境中.

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.

要解决它,请将其添加到您的 Gemfile 中:

To resolve it, add this in your Gemfile:

gem "iconv", "~> 1.0.3"

然后运行bundle install.

注意: iconv 已被弃用一段时间.它被(内置)String#encode
替换请参阅此处:https://bbs.archlinux.org/viewtopic.php?id=160369

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

这篇关于在“需要"中:没有要加载的此类文件- iconv (LoadError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆