2011-10-20 112 views
16
➜ 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' 

我試圖安裝在'需要':沒有這樣的文件來加載 - 的iconv(LoadError)

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

偶試過Why does installing Nokogiri on Mac OS fail with libiconv is missing?

沒有用。請幫忙!

謝謝!

回答

31

它顯示t帽子iconv不存在,但iconv已安裝在我的生產環境。

[email protected]/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補充一點:

gem "iconv", "~> 1.0.3" 

然後運行bundle install

注意:iconv已被棄用一段時間。它被替換(內建)字符串#編碼
請參閱:https://bbs.archlinux.org/viewtopic.php?id=160369

+2

指定iconv gem在Ruby 2.0.0上爲我工作。謝謝! –

+0

比重新編譯好得多,永遠花了:) – Kevin

+0

很好,謝謝 –

6

對於使用rbenv代替RVM那些

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

然後使用的iconv的目錄位置重新安裝紅寶石

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

好運

(作爲一個方面說明,這個錯誤據報道發生在Ruby 1.8.7-p3xx中)

相關問題