You are not logged in.

#1 2013-03-27 12:42:39

saronno
Member
Registered: 2009-10-02
Posts: 116

Ruby: cannot load such file -- iconv (LoadError)

I installed ruby and I have been trying to use it with metasploit, but everytime I launch msfconsole or msfcli
I get this error:

/usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- iconv (LoadError)
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/zip/zip.rb:3:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/zip.rb:1:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/core/db.rb:27:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/core/db_manager.rb:5:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/core/framework.rb:69:in `<class:Framework>'
    from /opt/metasploit/lib/msf/core/framework.rb:13:in `<module:Msf>'
    from /opt/metasploit/lib/msf/core/framework.rb:5:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/core.rb:34:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/ui/console/driver.rb:2:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/ui/console.rb:11:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/lib/msf/ui.rb:11:in `<top (required)>'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /opt/metasploit/lib/fastlib.rb:374:in `require'
    from /opt/metasploit/msfconsole:136:in `<main>'

I think it's a problem regarding ruby rather than metasploit.
Maybe there is something wrong with the package (2.0.0_p0-1)

Offline

#2 2013-03-27 17:06:54

stronnag
Member
Registered: 2011-01-25
Posts: 38

Re: Ruby: cannot load such file -- iconv (LoadError)

iconv has been deprecated for a while. It is replaced by (builtin) String#encode

* Downgrade to an older ruby; or
* Ask metasploit to fix their code.

Online

#3 2013-03-28 01:44:41

saronno
Member
Registered: 2009-10-02
Posts: 116

Re: Ruby: cannot load such file -- iconv (LoadError)

Thanks. I downgraded to a previous version of ruby and now everything works fine.

Offline

Board footer

Powered by FluxBB