2011-10-20 27 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' 

He intentado instalaren `require ': No existe el fichero a cargar - iconv (LoadError)

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

incluso trató Why does installing Nokogiri on Mac OS fail with libiconv is missing?.

Nada funciona. ¡Por favor ayuda!

Gracias!

Respuesta

31

Muestra t que el ícono no existe, pero iconv se ha instalado en mi entorno de producción.

[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. 

Para resolverlo, añadir esto en su Gemfile:

gem "iconv", "~> 1.0.3" 

A continuación, ejecute bundle install.

Nota: iconv ha quedado obsoleto por un tiempo. Es reemplazado por (integrado) String # encode
Ver aquí: https://bbs.archlinux.org/viewtopic.php?id=160369

+2

Especificar la gema iconv trabajada para mí en Ruby 2.0.0. ¡Gracias! –

+0

Mucho mejor que recompilar, eso llevó una eternidad :) – Kevin

+0

Funciona muy bien, gracias –

6

Para aquellos que utilizan rbenv en lugar de RVM

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

A continuación, utilice la ubicación del directorio de iconv para volver a instalar el rubí

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

Buena suerte

(Como nota al margen, este error ha se ha informado que ocurre en Ruby 1.8.7-p3xx)

Cuestiones relacionadas