Evil-WinRM Error: Gem::UnsatisfiableDependencyError
I was having trouble getting Evil-WinRM running on Kali 2022.2, with the following error:
/usr/lib/ruby/vendor_ruby/rubygems/resolver.rb:233:in `search_for': Unable to resolve dependency: 'gssapi (~> 1.2)' requires 'ffi (>= 1.0.1)' (Gem::UnsatisfiableDependencyError)
This despite gem list
showing ffi version 1.15.5 installed.
Not knowing a whole lot about Ruby, or Evil-WinRM for that matter, I suspect there may have been dependency issues related to Ruby 2.7 and Ruby 3.0 being installed side by side. Or, more likely, I just screwed up my Ruby install in the past without realising…
Regardless, if you’re getting the above error and pulling your hair out, a simple solution appears to be to uninstall Ruby along with all Gems, and to reinstall Ruby and Evil-WinRM fresh.
Uninstall Ruby:
sudo apt purge ruby -y
Remove all Gems:
sudo rm /var/lib/gems/ -rf
Reinstall Ruby
sudo apt install ruby ruby-dev
Reinstall Evil-WinRM
sudo gem install evil-winrm