karlos
karlos

Reputation: 980

How to specify indirect gem dependency version in rails Gemfile

In my Gemfile, i have:

 gem 'msgpack_rails'
 gem 'google-authenticator-rails'
 .. etc

Inside Gemfile.lock i see:

google-authenticator-rails (2.0.0)
      actionpack
      activerecord
      google-qr
      rails
      rotp (= 3.3.0)

How can I specify actionpack and activerecord versions inside google-authenticator-rails gem ?.

Do I need to write directly inside Gemfile.lock like this:

google-authenticator-rails (2.0.0)
  actionpack (>2)
  activerecord (>6)
  google-qr
  rails
  rotp (= 3.3.0)

Upvotes: 0

Views: 477

Answers (1)

Tom Lord
Tom Lord

Reputation: 28305

To answer your original question directly, the correct way to update that part of the Gemfile.lock would be to tighten the version constraints here: https://github.com/jaredonline/google-authenticator/blob/a5d3d344cf8f10abd4c0bf85606c632dce48ca80/google-authenticator.gemspec#L27-L32

However, I don't see any evidence why this is necessary. I think you are confused between dependencies and constraints.

Your project is already using activerecord version 6.0.3.2. Tightening the constraints of google-authenticator-rails won't change this fact.

You can see what versions of all dependencies your project is using by running: bundle list.

Upvotes: 2

Related Questions