Bundler: You must use Bundler 2 or greater with this lockfile

前端 未结 18 2350
小蘑菇
小蘑菇 2020-12-04 14:13

I\'m working with heroku and every time I try to push my app this message shows out:

remote: Compressing source files... done.
remote: Building source:
remo         


        
相关标签:
18条回答
  • 2020-12-04 14:38

    I deleted the project and made a git clone from the Heroku app, don´t know if it is a good solution, but it worked for me.

    0 讨论(0)
  • 2020-12-04 14:39

    Even with bundler 2 on the system this error still happens when deploying an app with Ruby 2.6 since Ruby 2.6 ships with a default version of bundler.

    If you are using Ruby 2.6 then upgrade to Ruby 2.6.1 to avoid this issue.

    0 讨论(0)
  • 2020-12-04 14:39

    If you're using a docker image like FROM:ruby:2.X.X then you can do the following:

    FROM ruby:2.6.2
    ... # omitted
    COPY Gemfile /myapp/Gemfile
    COPY Gemfile.lock /myapp/Gemfile.lock
    RUN gem uninstall bundler
    RUN gem install bundler -v 2.1.4
    RUN bundle update --bundler
    RUN bundle install
    ... # omitted
    
    0 讨论(0)
  • 2020-12-04 14:40

    For local system

    gem install bundler:2.0.0.pre.1
    bundle _2.0.0.pre.1_ install
    

    Where "2.0.0.pre.1" is whatever version you need to bundle with.

    Don't delete your Gemfile.lock for this, it's there for a reason.

    0 讨论(0)
  • 2020-12-04 14:41

    I got the same issue in my local system, my ruby version was low due to which the error was occurring. Fixed it by switching it to updated versions of ruby.

    0 讨论(0)
  • 2020-12-04 14:41

    The Ruby 2.6.0 is not the case of this problem. The default version of Bundler incorrectly invoked when using bin stubs. For more details please refer the following link

    Solution: Bundler 2 is available on the system and is the latest version, So it should be invoked instead of the default bundler version.

    Update Rubygems

    gem update --system
    

    Update bundler

    gem install bundler
    

    Update Gemfile.lock in your project

    bundler update --bundler
    
    0 讨论(0)
提交回复
热议问题