Unable to update gems on production server

后端 未结 7 1654
攒了一身酷
攒了一身酷 2021-01-31 03:17

Can not update gems on production server.

I\'ve tried bundle install --deployment and bundle install --without development test

But kee

7条回答
  •  深忆病人
    2021-01-31 03:58

    The instructions are probably a bit confusing. It's saying that you've modified your Gemfile on your development machine and just pushed those changes rather than running bundle install BEFORE committing the changes.

    By running bundle install you will update your Gemfile.lock file. This should be pushed to your server as it's more important than Gemfile. Consider the Gemfile the plans for the Gemfile.lock file.

    Always remember to:

    1. Run bundle install if you change your Gemfile, even just to make sure. If it's too slow, pass --local through which forces it to only use local gems to resolve its dependencies.
    2. Commit both the Gemfile and Gemfile.lock file to your repository
    3. Deploy both the Gemfile and Gemfile.lock to your production servers to ensure that they're running the exact same dependencies as your development environment.

    Running bundle update by itself can be construed as dangerous that will update all the dependencies of your application. It's mainly dangerous if you don't have solid version numbers specified in the Gemfile. I wrote about it here.

提交回复
热议问题