Code Monkey home page Code Monkey logo

Comments (6)

rafaelfranca avatar rafaelfranca commented on July 22, 2024 3

Any reason why we are trying to add the Ruby version on the Gemfile? Right now, the only tool that actually doesn't know how to read .ruby-version is Heroku, and I'm pretty sure we can teach Heroku to read it.

from rails.

rafaelfranca avatar rafaelfranca commented on July 22, 2024

I had to revert the change because it blocks devcontainers. See 707b5cb.

I'll reapply it when we have our own devcontainer ruby images.

from rails.

matthewd avatar matthewd commented on July 22, 2024

The original addition was here:

I don't recall whether there is now, or was historically, a difference in how Bundler will resolve a gemfile given the presence/absense of a ruby directive -- beyond the obvious hard-stop if the running version doesn't match.

In that original PR, @deivid-rodriguez recommended ruby RUBY_VERSION instead of duplicating the value; that still strikes me as a bit of a warty [and tautological] spelling, even compared to the new file: syntax... but it does leave me wondering what we lose by just omitting the line entirely.

from rails.

matthewd avatar matthewd commented on July 22, 2024

Spellings aside, the fact the file: syntax locks us so rigidly to a precise version (per 707b5cb) is IMO, Quite Unfortunate.

from rails.

rafaelfranca avatar rafaelfranca commented on July 22, 2024

We can also do ruby "~> 3.2.0" if we need to specify a version to match more what you expect this check do to. It is still duplicating the value, but at least it will not hard fail anymore.

So far, I don't know what we lose by omitting the ruby line. If all tooling is already reading from .ruby-version, that alone should keep consistent resolution for bundler.

from rails.

deivid-rodriguez avatar deivid-rodriguez commented on July 22, 2024

I think ruby DSL just adds an extra dependency on the language version for your app. I think people will typically use it when directly depending on Ruby features particular to some Ruby versions. Transitive dependencies may or may not add a dependency on the language version. By using the Ruby DSL, you make what the application supports explicit. As mentioned, ruby can take a relaxed or exact requirement, making the application more or less picky when run on different rubies.

I think it's up to each user/use case what to use. Maybe for freshly generated Rails apps it's indeed best to be as flexible as possible by avoiding the ruby line altogether.

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.