This command worked for me in removing documentation installed by install.
rm -r "$(gem env gemdir)"/doc/*
Here's another way to go about it;
To locate the folder where gems are installed on your system, simply run the following on terminal or shell
gem env home
This will display an output like
/home/username/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0
You can then locate the docs folder and delete all the documentations that you find there for each gem in a ruby version
I also want to add this too to the answers provided,
if want to prevent gems from generating documentation during installation, then turn off local documentation generation by creating a file called ~/.gemrc which contains a configuration setting to turn off this feature:
Simply run this code in your terminal or shell
printf "install: --no-rdoc --no-ri\nupdate: --no-rdoc --no-ri\n" >> ~/.gemrc
OR
echo "gem: --no-document" > ~/.gemrc
This will prevent gems from generating documentation during installation, saving you the stress of deleting/removing gem documentations on your system later.
That's all
I hope this helps.