Have you ever run into this error?

Your Ruby version is 2.6.1, but your Gemfile specified 2.6.3

Annoying, right? You know your Ruby version is new enough to run this application, but the Gemfile is so fussy.

Turns out, Gemfiles don't have to be so picky. Just like you can relax version dependencies for gems, you can also make your Ruby version specifier less specific. As with gems, the secret is using the tiddly-waka (~>) operator:

ruby '~> 2.6.0'

Now this project will run with any patch version of Ruby 2.6 without complaint.

Published by Avdi Grimm

3 Comments

  1. What happened/happens to the “Virtuous Code” blog? http://www.virtuouscode.com/

    Reply
  2. Couldn’t you write this tip 30 headaches ago?….
    Thanks 🙂

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *