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
Generating an Instagram- or Youtube-Like Unguessable String Id in Ruby/Activerecord
How to Format This International Phone Number in Rails
How to Access Attributes Using Nokogiri
How to Customize Rails Activerecord Validation Error Message to Show Attribute Value
How to Use Gems Not in a Gemfile When Working with Bundler
Why Doesn't "Rails S" Work from the App Directory
Rails Carrierwave Base64 Image Upload
Rails - Local Variables Versus Instance Variables
How to Generate Links with Trailing Slash in Rails 3
Complicated Graphviz Tree Structure
How to Convert a Ruby Object to JSON
What Is '-Mix' in a Ruby Regular Expression
Ruby (And Rails) Nested Module Syntax
What Is the Best Practice When It Comes to Testing "Infinite Loops"
Why Do I Get an Error Installing the JSON Gem in Ubuntu