2017-04-15 16 views
5

我正在Windows机器上构建一个rails站点,我在Gemfile.lock的检查我得到我的特拉维斯以下错误构建:我该如何解决“您的软件包仅支持平台[”x86-mingw32“],但您的本地平台是[”ruby“,”x86_64-linux“]”

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

名单

以下是完整的日志:https://travis-ci.org/bikebike/BikeBike/builds/222395810#L654

我看了看我的Gemfile.lock的,并且声明:

PLATFORMS 
    x86-mingw32 

这似乎是问题的一部分。我试图把任何Windows特定的宝石在platforms块:

platforms 'mswin', 'mingw', 'mswin64', 'x64_mingw' do 
    gem 'tzinfo-data' 

    group :test do 
    gem 'wdm', '>= 0.1.0' 
    gem 'win32console', require: false 
    end 
end 

但Gemfile.lock的看起来是一样的。

这是我的全部GemfileGemfile.lock

我可以通过从git中删除Gemfile.lock文件暂时解决该问题,但这不是最佳实践。无论如何,我可以提交我的Gemfile.lock文件并继续在Windows机器上开发?

回答

8

运行在命令行下面的两个命令:

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

这将增加两个平台在Gemfile.lock的

部署到Google云,当我有同样的错误。但是运行这两个命令后,添加了ruby和x86_64-linux,问题解决了。