Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get version of gem within ruby

Tags:

ruby

Is there a way to require a gem and then get the version number of that gem from within ruby?

like image 319
Jake Avatar asked Dec 03 '22 05:12

Jake


1 Answers

You could try

Gem.loaded_specs[$NAME_OF_GEM].version
like image 141
pgmura Avatar answered Jan 20 '23 12:01

pgmura