Unable to update gems on production server

后端 未结 7 1649
攒了一身酷
攒了一身酷 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:49

    FYI: You can also get this error if you use source blocks like this:

    source 'https://rails-assets.org' do
      gem 'rails-assets-jquery'
    end
    

    You'll see an exclamation point in the Gemfile.lock for this gem:

      rails-assets-jquery!
    

    Just define the additional source normally, i.e.

    source 'https://rails-assets.org'
    gem 'rails-assets-jquery'
    

    (BTW cf. here about using multiple gem sources.)

    0 讨论(0)
  • 2021-01-31 03:53

    I have had this problem (Ubuntu 12.10 & 12.04, one of which behind a proxy server). My problem was that I had some git:// protocols in the Gemfile. Changing this to http:// helped me get it all working.

    0 讨论(0)
  • 2021-01-31 03:54

    FWIW I had this problem and fixed it by removing some conditional statements from my Gemfile (conditionals on OS) and rerunning bundle.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-31 03:59

    This can be caused by an old version of the bundler gem on the server you're deploying to (in this case production). Logging into the server and running a gem update bundler resolved the issue for me. The server I was deploying to was running version 1.7.4 and the current version was 1.9.

    0 讨论(0)
  • 2021-01-31 04:06

    I had an issue with my production server still using an old version of a gem, even though the Gemfile.lock showed the correct, updated version. My production server was running on Unicorn - and shutting down / starting it back up again fixed the issue - instead of sending the HUP signal, which did jack all to fix the issue.

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