rapid7 / meterpreter

THIS REPO IS OBSOLETE. USE https://github.com/rapid7/metasploit-payloads INSTEAD
Other
325 stars 144 forks source link

mkmf.rb compiler failed to generate executable file after upgrade #172

Open ghostop14 opened 9 years ago

ghostop14 commented 9 years ago

I have 2 kali systems running metasploit, one I held back the latest 4.11.3 upgrade until yesterday's repo release and one I had upgraded earlier (that had the errors everyone's run into). This morning the one I had held the upgrade back on upgraded fine and everything works, the one that got the intermediate broken upgrade now shows the following error trying to run either msfconsole.framework or msfconsole:

msfconsole.framework /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

/opt/metasploit/ruby/bin/ruby extconf.rb

checking for labs() in stdlib.h... /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:541:intry_link0' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:556:in try_link' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:736:intry_func' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:1021:in block in have_func' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:912:inblock in checking_for' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:351:in block (2 levels) in postpone' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:321:inopen' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:351:in block in postpone' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:321:inopen' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:347:in postpone' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:911:inchecking_for' from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:1020:in have_func' from extconf.rb:3:in

'

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.2@global/gems/bigdecimal-1.2.7 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.2.2@global/extensions/x86_64-linux/2.1.0/bigdecimal-1.2.7/gem_make.out from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in block in build' from /opt/metasploit/ruby/lib/ruby/2.1.0/tempfile.rb:324:inopen' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in build' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:inblock (2 levels) in build_extension' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in chdir' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:inblock in build_extension' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in synchronize' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:inbuild_extension' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in block in build_extensions' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:ineach' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in build_extensions' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/specification.rb:1436:inblock in build_extensions' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in use_ui' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/specification.rb:1434:inbuild_extensions' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in build_extensions' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:incontains_requirable_file?' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/specification.rb:925:in block in find_inactive_by_path' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/specification.rb:924:ineach' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/specification.rb:924:in find' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/specification.rb:924:infind_inactive_by_path' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems.rb:185:in try_activate' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:inrescue in require' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in require' from /usr/share/metasploit-framework/config/boot.rb:26:in<top (required)>' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /opt/metasploit/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/bin/msfconsole.framework:45:in `

'

I've tryed apt-get purge and removed the directories manually then reinstalled, no luck. I've tried going into /usr/share/metasploit-framework and doing a bundle install, taking care of any missing -dev libraries, and everything installs correctly. ruby --version even reports the correct version (ruby 2.2.2p95 (2015-04-13 revision 50295)).

I looked at the log file it references and it just contains the same error info so I'm not sure what it thinks is missing? Any gem / package I may be missing or something the upgrade/installer can check?