ruby - Which version of gem is used when there is no Gemfile -


there similar question here. ruby: rails: version of gem used?

but it's when gemfile used.

i want know if there no gemfile, version of gem used.

for example have 4 versions of selenium-webdriver in system.

 % gem list | grep selenium selenium-webdriver (2.53.0, 2.48.1, 2.46.2, 2.45.0) 

and use pry , require 'selenium-webdriver. how can know version used? latest selected?

you have more 1 gem because each project gemfile in machine have 1 different version of it.

when using gem via require or command line without specifying version last 1 - greater version - automatically used.

by convention, in part of cases, can print version doing following:

require 'some_gem' puts somegem::version # => "3.0.3" 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -