-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider pulling bundler version from lock file #38
Comments
It's a great idea. Maybe bundler should just be able to do that, e.g. |
I think the plan at rubygems/rubygems#3073 (comment) is related to this issue. I'm not sure how far away that is from happening, so I guess this would be great to have until then. Not sure how tricky this idea is, as written in the README here, Ruby >= 2.6 comes with Bundler installed. |
Interesting idea indeed. Bundler 2 can handle Gemfile.lock generated by Bundler 1 nowadays, unfortunately the Bundler Version Selector in RubyGems causes issues with that: rubygems/rubygems#3073 As @dentarg mentioned this might improve in new releases of RubyGems and Bundler. It's not clear to me what's the right thing to do here. Currently as the README mentions every Ruby built for A workaround is to remove the Given all this, I would lean toward adding this feature, but disabled by default, so there would be a new input like |
Also Bundler and RubyGems were merged recently, which might mean (I'm not sure) there might just be a single Bundler version for a given Ruby installation. In that case we wouldn't be able to |
I just read up on the discussion linked above and feel like this Action should probably wait for upstream solutions. Thanks for considering the idea and the great discussion. As a user of this Action, I have easy solutions as is: use the version included with the ruby version or install my own. Thanks! (I'm happy to close this but as others 👍 I'm hesitant to do that, but I'd fully support it being closed after better understanding the situation). |
@JPrevost have you found a reasonable solution to get bundler 2.1.4 installed, even if brute forced, but properly cached? I would prefer CI bundles with the same version as production deployment. |
@rromanchuk not really, but installing only takes a few seconds on average so I've mostly convinced myself to let it go |
I think caching the installation is not really feasible by this action (except one version when building Ruby). As @JPrevost says, at least on Linux/macOS for MRI installing Bundler should be just a couple seconds.
If the Gemfile.lock exists, I would think it's fine to use any version of Bundler with the same major version as |
Maybe that's actually a simple resolution for this issue: ensure there is a pre-installed Bundler 1 and a Bundler 2 for every Ruby version >= 2.3 (Bundler 2 drops support for Ruby < 2.3). Then it should work to install from any Gemfile.lock. Thoughts? |
Ironically, this conversation made me look at what we actually use in production rather than what I assumed we were using in production. We deploy on Heroku and they seem to drop the |
Yes, |
Since https://github.com/ruby/setup-ruby/releases/tag/v1.28.0 Bundler will be installed by setup-ruby, so we'll have more flexibility. For the default I'm not sure yet. |
For default I personally like checking I was using ruby 2.6.5 and a 2.x version of |
LGTM.
Add that, and RubyGems might be next. I'd say just look at the Gemfile... |
Implemented in #47 I added the input so the user can control if the default is not what they want. |
It seems Bundler 2 by default causes not very clear failures, e.g. oracle/truffleruby#1984 I hope that's a rare case, otherwise we might have to change the default when there is no |
The support for using
.ruby-version
instead of having to supply it directly is so nice. Thanks!Would you consider doing something similar with the bundler version from
Gemfile.lock
?It's not a huge deal to install the version the project is using manually, but when I saw how nicely you made the ruby version work I figured it was worth considering to make this super simple to use in a nearly drop in and run way for many projects.
Either way, thanks so much for this Action!
The text was updated successfully, but these errors were encountered: