Ruby gem exception: invalid option

The errors

Error: Execution of '/usr/bin/gem install --no-rdoc --no-ri cowsay' returned 1: ERROR:  While executing gem ... (OptionParser::InvalidOption)invalid option: --no-rdocDid you mean?  no-force

The ‘quick fix’

W.r.t. the reference article, I searched for the file ‘gem.rb’. Since ‘locate’ was not installed in the OS, I used the ‘find’ command to look for the file:

> find / -name 'gem.rb'
/usr/lib/ruby/vendor_ruby/puppet/provider/package/gem.rb
#command << "--no-rdoc" << "--no-ri" << resource[:name]
command << "--no-document" << resource[:name]

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store