Check gem version number

Every gem has ::VERSION constant.. so just use Rack::VERSION or OpenSSL::VERSION in console which should give you the version of gem loaded in that console.


Rack.version

will return the protocol version,

Rack.release

is probably what you are you looking for.

https://github.com/rack/rack/blob/master/lib/rack.rb#L14

Otherwise:

Gem.loaded_specs["rack"]

Example:

Gem.loaded_specs["rack"]
# => #<Gem::Specification name=rack version=1.3.2> 
Gem.loaded_specs["rack"].version
# => #<Gem::Version "1.3.2"> 
Gem.loaded_specs["rack"].version.to_s
# => "1.3.2"