Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在“require';”中:没有要加载的文件--iconv(LoadError)_Ruby On Rails_Ruby_Terminal_Rvm_Iconv - Fatal编程技术网

Ruby on rails 在“require';”中:没有要加载的文件--iconv(LoadError)

Ruby on rails 在“require';”中:没有要加载的文件--iconv(LoadError),ruby-on-rails,ruby,terminal,rvm,iconv,Ruby On Rails,Ruby,Terminal,Rvm,Iconv,我试过安装 ➜ 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/

我试过安装

    ➜  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的人

rvm pkg install readline
rvm pkg install iconv
rvm install 1.8.7
rvm use 1.8.7 
然后使用iconv的目录位置重新安装ruby

$ which iconv
$ /usr/local/bin/iconv
祝你好运


(作为旁注,Ruby 1.8.7-p3xx中报告了此错误)

它表明iconv不存在,但iconv已安装在我的生产环境中

$ CONFIGURE_OPTS="--with-iconv-dir=/usr/local" rbenv install 1.8.7-p358
要解决此问题,请将其添加到您的文件中:

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.
然后运行
捆绑安装

注意:iconv已被弃用一段时间。它被(内置)字符串#encode替换

请参见此处:

在Ruby 2.0.0上指定iconv gem对我很有用。谢谢这比重新编译要好得多,这要花很长时间:)这对我不起作用。我得到错误
error:在执行gem时。。。(Gem::CommandLineError)未知命令iconv,
gem "iconv", "~> 1.0.3"