How can I solve "Your package only supports the platforms [" x86-mingw32 "], but your local platforms: [" ruby ​​"," x86_64-linux "]"

I create a rails site on a Windows machine, but when I check my Gemfile.lock, I get the following error on my Travis builds:

Your bundle only supports platforms ["x86-mingw32"] but your local platforms are ["ruby", "x86_64-linux"], and there no compatible match between those two 

lists

Here is the complete magazine: https://travis-ci.org/bikebike/BikeBike/builds/222395810#L654

I looked at my Gemfile.lock file and it says:

 PLATFORMS x86-mingw32 

This seems to be part of the problem. I tried putting any special objects in the platforms block:

 platforms 'mswin', 'mingw', 'mswin64', 'x64_mingw' do gem 'tzinfo-data' group :test do gem 'wdm', '>= 0.1.0' gem 'win32console', require: false end end 

But Gemfile.lock looks the same.

Here is my full Gemfile and Gemfile.lock .

I can temporarily fix the problem by deleting the Gemfile.lock file from git, but this is not the best practice. Is there anyway that I can commit my Gemfile.lock file and continue development on my Windows machine?

+5
source share
1 answer

Run the following two commands on the command line:

 bundle lock --add-platform ruby bundle lock --add-platform x86_64-linux 

This will add two platforms to Gemfile.lock

I had the same error when deploying to Google Cloud. But after running these two commands, rubies and x86_64-linux were added, and the problem was resolved.

+10
source

Source: https://habr.com/ru/post/1266768/


All Articles