Travis Reports Odd Message of Corrupted Gemfile.Lock

Travis reports odd message of corrupted Gemfile.lock

We've seen a very similar issue today on Buildkite due to the recent release of a new bundler version
https://rubygems.org/gems/bundler/versions/1.11.0

We got the build working by stipulating the version of bundler to install.

gem install -v 1.10.6 bundler --no-rdoc --no-ri

and forcing the use of that

bundle _1.10.6_ install

cap production deploy | Gemfile.lock corrupt

Apparently, this is due to a Bundler issue. s01ipsist's answer on Travis reports odd message of corrupted Gemfile.lock suggests using Bundler 1.10.6. Bundler's issue #4467: Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES section also suggests using 1.10.6.

I uninstalled all versions of Bundler then installed 1.10.6 only. Afterwards, a deploy to Heroku passed.

Error deploying to Heroku from Windows: says thread_safe is missing but it's there

I "fixed" the problem by specifying JRuby as the engine in my Gemfile:

ruby '2.2.2', :engine => 'jruby', :engine_version => '9.0.0.0'

So I'm still not sure what was happening, just that the generic Heroku Rails 4.x start guide isn't sufficient for Windows...must rely on this one and dig into their sample app to make your own.

Corrupt Gemfile.lock Error with Capistrano

Looks like you are developing on a Windows machine. My guess is that you are trying to deploy to Linux. I'm sorry to say, that's not going to work.

You'll notice that your Gemfile.lock has references to the x86-mingw32 version of Nokogiri, which can't be used on the server.

There is no easy solution to this, unfortunately. Heroku solves this problem by completely deleting the Gemfile.lock during deployment, which forces Bundler to re-resolve all dependencies. This works, but now your dependencies are no longer locked and are unpredictable. Heroku will say:

Removing Gemfile.lock because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
In rare occasions Bundler may not be able to resolve your dependencies at all.
https://devcenter.heroku.com/articles/bundler-windows-gemfile

You could do something similar in Capistrano with some custom code that deletes Gemfile.lock before the Bundler task runs (or just remove Gemfile.lock from source control entirely). You'd also have to change the Bundler arguments to remove the --deployment flag, otherwise it will fail when it sees the Gemfile.lock is missing.

Or you could switch your development environment to Mac or Linux, e.g. by using a Linux VM for development.

Linux Remote server cap production deploy

First, try to delete your Gemfile.lock and run bundle install.
If that will not help try to downgrade the bundler version as in question post



Related Topics



Leave a reply



Submit