I\'m trying to deploy my app using Capistrano, but I\'m getting this error:
Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES
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.