Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The method to infer the present gem name in Ruby is:

Gem::Specification.find_by_name("gem_name").name

Replace gem_name with the name of the gem you want to find. This code uses the Gem::Specification.find_by_name method to retrieve the specification object of the gem and then retrieves its name using the name method.