Metasploit cannot load such file -- nmap/xml - ruby

Msfconsole has been working fine, all of a sudden I get this error. It also states:
Load error: Make sure the Ruby gems are installed properly, run bundle install- which I did and after fiddling with it, it completed successfully. Any tips?

try this out:-
install ruby-nmap gem
gem install ruby-nmap

Related

Trying to put bundle in PATH

I'm working on a Ruby project that requires the use of a few gems. I'm a bit confused, since I thought I already had bundler installed on my Mac. I tried installing it just now and got the following error:
Leias-MacBook-Pro:spec leia$ gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
I then tried using --user-install, a trick I picked up from browsing Stack Overflow.
Leias-MacBook-Pro:spec leia$ gem install bundler --user-install
WARNING: You don't have /Users/leia/.gem/ruby/2.3.0/bin in your PATH, gem executables will not run.
Successfully installed bundler-2.0.2
Parsing documentation for bundler-2.0.2
Done installing documentation for bundler after 5 seconds
1 gem installed
Now, I kind of need the gem executables to run, so I opened my .bash_profile and dropped the following code in:
export PATH=/Users/leia/.gem/ruby/2.3.0/bin:$PATH
But no matter how I try to fix it, bundle still won't run. The gem I'm installing is rspec, and I definitely need to be able to run those executables. Am I doing something wrong here? I've tried to follow tutorials and Google similar issues, but I can't figure out what the problem is. Any pointers or suggestions?

Add Gem WDM to GemFile in Git Never works

I am trying to use Middleman to create a website, and I am running into a lot of issues with trying to do it. To solve these issues I am currently running ruby through the git interface to resolve several errors that I get when trying to do this by other methods (like cmd). Right now I am having an issue getting the first step in doing a website with Middleman and getting errors when executing the first command in the first step of the tutorial.
I have found no resolution to my problem of WDM not working at all. Here is an image of what happens when I try to execute the command middleman init. After getting this Error I run bundle install and try again and get this Amazing Error that I have found no source in finding out how to fix. When I Do gem install WDM -v '0.1.1' --source 'https://rubygems.org/' it seems to work but then spits out the same error when I run middleman init again. I have no idea why this is happening when I can find no other sources on how to fix this.
Did you try running the suggested command at the bottom
gem install wdm -v '0.1.1' --source 'https://rubygems.org/'
?

'no such name' error on all gem install attempts

I just installed Ruby 2.2.2 on a Windows 7 64-bit VM. Every gem install <gemname> attempt fails with the following error:
ERROR: Could not find a valid gem '<gemname>' ()= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name
(https://api.rubygems.org/specs.4.8.gz)
However, the list generated by the gem list contains the gem that I thought failed. Is it actually installed or not? I assume it isn't but even if it is, the error concerns me.
I know that I am working behind a proxy so I've tried appending --http-proxy but that hasn't helped either.
Any ideas to troubleshoot this? Thanks!
It's possible that one of the gems that you installed declares an invalid dependency such as <gemname> (specifically).
To validate this, open an irb or pry console and run Gem.loaded_specs to see if the string <gemname> shows up anywhere.
You could also try updating your rubygems with gem update --system.
And finally, you could also try to run gem check to validate all installed gems.
Unfortunately, this appears to be an issue that needs to be investigated to get to the root cause.
I ran into the same issue before figuring out my session was fucked up. Indeed the command whoami was displaying an id and not my username. I logged out and logged in again and everything was solved.

why is this sass command giving me an error

I am trying to learn sass so I can develop my front end skills a little bit more because that is what I hope to be some day. The only thing is I can't get sass to work.
Whenever I run the sass --watch . command it returns this error.
>>> Sass is watching for changes. Press Ctrl-C to stop.
write ./test.css
LoadError: no such file to load -- rb-fsevent
Use --trace for backtrace.
I did a bit of research on this error and it was suggested on this site to just simply install the rb-fsevent file that is missing so I ran the gem install rb-fsevent command and then got this error.
Fetching: rb-fsevent-0.9.4.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
so I did a bit of research on THIS error and it was suggested agin on this site to just run the install with sudo. So i did just that I didn't get an error so i was quite excited because I have been fighting with this for a while so i want back to the start of this question and ran the --watch command and got the same exact error. Can anyone help me fix this?
Your first error is because Ruby can't load the rb-fsevent gem. This could be because the gem is not installed. Trying to install the gem was a good idea.
Your second error is because you are trying to install the gem to a directory that you do not have permissions for. Using sudo to do the install is an acceptable solution. You can also do gem install --user-install to install to your home directory.
You are still getting the first error because even though the gem is installed, Ruby cannot load it. This could be because sudo installed the gem with the wrong permissions, or installed it to the wrong location, or Ruby is looking for it in the wrong location.
Thus your solution would be to
Locate the gem files you installed
Check that their permissions allow you to read them
Check ruby -e 'p $LOAD_PATH' to see if Ruby is looking in the right place for the gem

Installing mysql2 gem on Windows 8

I'm trying to install the mysql2 gem on Windows 8 (Ruby 1.9.3 and Rails 4.0.1). I've installed the Devkit and it's working properly, and I'm entering the following:
gem install mysql2 --platform=ruby -- '--with-mysql-lib="C:\mysql-connector\lib" --with-mysql-include="C:\mysql-connector\include" --with-mysql-dir="C:\mysql-conector"'
I've done this before and it's worked, but for some reason this time it's throwing this bizarre message:
Cannot find include dir at C:\mysql-connector\include;C:\mysql-connector\include;C:\mysql-connector/include;
This is of course in addition to the whole "Could not create makefile for some reason..." message. I'm using the mysql connector that I found through a different post here--Ruby MYSQL2 gem installation on windows 7
Does anyone know how I can fix this? I really need this gem...
I figured this out...
All I had to do was:
gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector\"'
Strange though--last time it worked with the code above... Go figure...
I just ran into the exact same issue trying to install mysql2 0.3.14 on Window 64bit, Rails 3.2.15 and Ruby 2.0.0p247. I used a command very simliar to what user2986379 posted and it worked; literally 5 minutes later when I had to rerun the command to fix another issue it stopped working. I was even copying the command from notepad each time so there wasn't a typo. Odd.
Anyway, user2986379's solution of adding quotes to the paths helped me get past the issue, but I was still getting some errors. I ended up modifying the command by removing the single quotes. In case anyone needs it, here's the command I ran:
gem install mysql2 --platform=ruby -- --with-mysql-dir="C:\mysql-connector"
Lastly, just for completeness, I had to use the version of connector c located here. You can read more about why this is necessary at the bottom of https://github.com/brianmario/mysql2/issues/372. It will install fine, but without the special connector_c you might get a segmentation fault when you go to actually use the gem. (Don't forget to grab the libmysql.dll out of that special connector c zip file as well and place it in your ruby bin directory.)

Resources