pundit icon indicating copy to clipboard operation
pundit copied to clipboard

Commit a Gemfile.lock

Open dgmstuart opened this issue 6 years ago • 11 comments

The current recommendation of Bundler is to commit Gemfile.lock to reduce friction for contributors: https://bundler.io/man/bundle-install.1.html#THE-GEMFILE-LOCK

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

Currently this is failing on JRuby builds

On 9.1: The ultimate failure is LoadError: no such file to load -- rspec/core/rake_task

This previous warning might also be relevant:

Unable to use the platform-specific (java) version of pry (0.12.2) because it has different dependencies from the ruby version. To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again.

On 9.2: The ultimate failure is

2019-08-19T08:55:18.507Z [main] WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.
bundler: failed to load command: rake (/home/travis/build/varvet/pundit/vendor/bundle/jruby/2.5.0/bin/rake)
Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
  /home/travis/.rvm/gems/jruby-9.2.8.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in `block in find_spec_for_exe'
  /home/travis/.rvm/gems/jruby-9.2.8.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in activate_bin_path'
  /home/travis/build/varvet/pundit/vendor/bundle/jruby/2.5.0/bin/rake:23:in `<main>'
  org/jruby/RubyKernel.java:1022:in `load'

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

@olleolleolle this also seems to be missing bundler - possibly as a result of https://github.com/varvet/pundit/pull/609

It seems like we don't get a bundler preinstalled for free in this case? https://travis-ci.org/varvet/pundit/jobs/573720530

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

One way would be to create a Gemfile.jruby + Gemfile.jruby.lock and refer to that in the CI matrix elements that were about JRuby.

olleolleolle avatar Aug 19 '19 09:08 olleolleolle

@olleolleolle do you have an environment running JRuby which you could create that on?

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

@dgmstuart Oh, bundle executable missing. Am sorry to have introduced weirdness in the pipeline.

olleolleolle avatar Aug 19 '19 09:08 olleolleolle

@olleolleolle no worries! Should I revert that commit?

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

@dgmstuart Try it!

olleolleolle avatar Aug 19 '19 09:08 olleolleolle

@olleolleolle seems like it's a bug in older rubygems versions: https://bundler.io/blog/2019/05/14/solutions-for-cant-find-gem-bundler-with-executable-bundle.html

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

@dgmstuart Perhaps you'd like to add the before_install step only to the needy matrix elements, then?

olleolleolle avatar Aug 19 '19 09:08 olleolleolle

@olleolleolle I've made a separate branch for that.

I'm having trouble setting up JRuby in my environment - do you have it already installed in an environment somewhere?

dgmstuart avatar Aug 19 '19 09:08 dgmstuart

@dgmstuart I rebased and created an updated Gemfile.lock for today's oldest supported ruby version, but I haven't done anything with the JRuby conundrum partly because I'm also having issues installing JRuby.

I'm not sure if this PR is important enough to keep around, however. I'm willing to close this issue without resolution too considering its age and issues in getting it merged.

Burgestrand avatar Oct 29 '21 09:10 Burgestrand

A downside of this, which could be worked around, is that CI would no longer download the most up to date gems of our dependencies since it would only fetch the gems in the lockfile.

Either way, closing this since it's old and stale.

Burgestrand avatar Mar 10 '23 11:03 Burgestrand