September 19, 2017, 01:43:17 PM
Welcome, Guest. Please login or register.

If you are not part of the solution...You are part of the precipitate.

Author Topic: msfupdate problem ??  (Read 13219 times)

Offline CyberSpaceMan

  • Top Hat Member
  • Enthusiast
  • ********
  • Posts: 56
  • Internets: +2/-0
msfupdate problem ??
« on: April 06, 2013, 04:49:08 PM »
Ok so i tried updating metasploit today and when i did i got this error i dont really know how to fix it so if you guys maybe know how to thanks :)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /opt/metasploit/ruby/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /opt/metasploit/postgresql/bin/pg_config
checking for libpq-fe.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
   --with-opt-dir
   --without-opt-dir
   --with-opt-include
   --without-opt-include=${opt-dir}/include
   --with-opt-lib
   --without-opt-lib=${opt-dir}/lib
   --with-make-prog
   --without-make-prog
   --srcdir=.
   --curdir
   --ruby=/opt/metasploit/ruby/bin/ruby
   --with-pg
   --without-pg
   --with-pg-dir
   --without-pg-dir
   --with-pg-include
   --without-pg-include=${pg-dir}/include
   --with-pg-lib
   --without-pg-lib=${pg-dir}/lib
   --with-pg-config
   --without-pg-config
   --with-pg_config
   --without-pg_config
/opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:381: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/1.9.1/mkmf.rb:506:in `try_cpp'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
   from extconf.rb:43:in `<main>'


Gem files will remain installed in /opt/metasploit/ruby/lib/ruby/gems/1.9.1/gems/pg-0.15.0 for inspection.
Results logged to /opt/metasploit/ruby/lib/ruby/gems/1.9.1/gems/pg-0.15.0/ext/gem_make.out



An error occured while installing pg (0.15.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.0'` succeeds before bundling.

Offline Malachai

  • Top Hat Member
  • Super Elite
  • ********
  • Posts: 2805
  • Internets: +18/-7
  • #!/bin/sh Day/Night (Grey Hat)
Re: msfupdate problem ??
« Reply #1 on: April 06, 2013, 10:31:22 PM »
Trying doing it this way and see if you get the same error message.


msfconsole - once everything has loaded then type msfpro
** Dont' judge me! **

*//
  Hope that Firewall works because your SCREWED  
  //*

Offline CyberSpaceMan

  • Top Hat Member
  • Enthusiast
  • ********
  • Posts: 56
  • Internets: +2/-0
Re: msfupdate problem ??
« Reply #2 on: April 07, 2013, 06:06:19 AM »
Ok so this is what happens when i try msfconsole

Could not find pg-0.15.0 in any of the sources
Run `bundle install` to install missing gems.


and when i try gem install pg -v '0.15.0'

/usr/local/lib/site_ruby/1.9.2/rubygems/gem_runner.rb:73:in `<top (required)>': undefined method `load_plugins' for Gem:Module (NoMethodError)
   from /usr/bin/gem:9:in `require'
   from /usr/bin/gem:9:in `<main>'


And my OS is BackTrack 5 R3 32 Bit

Ok well ill keep trying myself and google this but sadly havent found anything :/
« Last Edit: April 07, 2013, 06:08:32 AM by CyberSpaceMan »

Offline CyberSpaceMan

  • Top Hat Member
  • Enthusiast
  • ********
  • Posts: 56
  • Internets: +2/-0
Re: msfupdate problem ??
« Reply #3 on: April 07, 2013, 06:26:36 AM »
No dont think so. How do i do Bundle Install ??

Offline CyberSpaceMan

  • Top Hat Member
  • Enthusiast
  • ********
  • Posts: 56
  • Internets: +2/-0
Re: msfupdate problem ??
« Reply #4 on: April 07, 2013, 06:28:25 AM »
NVM i got it and no Bundle installed didnt work either :(

/usr/local/lib/site_ruby/1.9.2/rubygems/compatibility.rb:19:in `<top (required)>': undefined method `remove' for Gem::QuickLoader:Module (NoMethodError)
   from /usr/local/lib/site_ruby/1.9.2/rubygems.rb:15:in `require'
   from /usr/local/lib/site_ruby/1.9.2/rubygems.rb:15:in `<top (required)>'
   from <internal:gem_prelude>:158:in `require'
   from <internal:gem_prelude>:158:in `load_full_rubygems_library'
   from <internal:gem_prelude>:212:in `push_gem_version_on_load_path'
   from <internal:gem_prelude>:16:in `gem'
   from /etc/alternatives/gem-bin/bundle:18:in `<main>'


Offline CyberSpaceMan

  • Top Hat Member
  • Enthusiast
  • ********
  • Posts: 56
  • Internets: +2/-0
Re: msfupdate problem ??
« Reply #5 on: April 07, 2013, 06:42:26 AM »
Ok ill do that i gotta go now tho so ill answer in a few hours and tell you how it went thanks for the help :)

Offline bobby

  • Prospect
  • *
  • Posts: 1
  • Internets: +0/-0
Re: msfupdate problem ??
« Reply #6 on: April 11, 2013, 03:24:22 AM »
Hello,

I have updated from backtrack5r2 to backtrack5r3 and had the same problem with metasploit.

I have modified this file : /opt/metasploit/ruby/lib/ruby/1.9.1/i686-linux/rbconfig.rb

changed the line => CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static"
by => CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) "


go to /opt/metasploit/msf3 and run /opt/metasploit/ruby/bin/bundle install
« Last Edit: April 11, 2013, 04:31:20 AM by bobby »

Offline justsomeguy

  • Prospect
  • *
  • Posts: 1
  • Internets: +0/-0
Re: msfupdate problem ??
« Reply #7 on: April 24, 2013, 02:02:46 PM »
Just the other day I started having this same problem with metasploit on BT5R3. The weird thing was that it worked fine before. I couldn't find the issue and eventually decided not only to reinstall metasploit - I reinstalled my entire backtrack. After apt-get update and apt-get upgrade I launch msfupdate and the SAME THING happens...!

Anyway, I have no idea what caused it but if you're having this issue, do what 'bobby' said. It worked for me.

Offline th3gr1m

  • Prospect
  • *
  • Posts: 7
  • Internets: +0/-0
  • 'Within Chaos...There is Profit'
Re: msfupdate problem ??
« Reply #8 on: April 27, 2013, 07:33:38 PM »
I have updated from backtrack5r2 to backtrack5r3 and had the same problem with metasploit.

I have modified this file : /opt/metasploit/ruby/lib/ruby/1.9.1/i686-linux/rbconfig.rb

changed the line => CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static"
by => CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) "

go to /opt/metasploit/msf3 and run /opt/metasploit/ruby/bin/bundle install

Worked for me! Thanks bobby!

Offline lightningmanic

  • Prospect
  • *
  • Posts: 9
  • Internets: +0/-0
Re: msfupdate problem ??
« Reply #9 on: May 30, 2013, 08:53:45 AM »
I tried following these directions and got to the end when I start msfconsole, I end up getting an error that says "Metasploit requires the Bundler gem to be installed".

So I ran "gem install bundler" and it succeeds.  However, I still get the same message when I run msfconsole.

Is the gem not installing properly or in the right directory?