简体   繁体   English

如何解决“您的软件包仅支持平台[”x86-mingw32“],但您的本地平台是[”ruby“,”x86_64-linux“]”

[英]How can I resolve “Your bundle only supports platforms [”x86-mingw32“] but your local platforms are [”ruby“, ”x86_64-linux“]”

I'm building a rails site on a Windows machine but when I check in my Gemfile.lock I get the following error on my Travis builds: 我正在Windows机器上构建一个rails网站但是当我检查我的Gemfile.lock时,我的Travis版本出现以下错误:

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

lists 名单

Here is the full log: https://travis-ci.org/bikebike/BikeBike/builds/222395810#L654 这是完整的日志: https//travis-ci.org/bikebike/BikeBike/builds/222395810#L654

I looked at my Gemfile.lock and it states: 我查看了我的Gemfile.lock并说明:

PLATFORMS
  x86-mingw32

Which appears to be part of the issue. 这似乎是问题的一部分。 I've tried putting any windows specific gems in a platforms block: 我已经尝试将任何特定于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

But the Gemfile.lock looks the same. 但是Gemfile.lock看起来是一样的。

Here is my full Gemfile and Gemfile.lock . 这是我的完整GemfileGemfile.lock

I can temporarily get around the issue by removing the Gemfile.lock file from git but this is not best practice. 我可以通过从git中删除Gemfile.lock文件来暂时解决这个问题,但这不是最佳做法。 Is there anyway that I can commit my Gemfile.lock file and continue to develop on my Windows machine? 无论如何,我可以提交我的Gemfile.lock文件并继续在我的Windows机器上开发?

Run the following two commands on the command line: 在命令行上运行以下两个命令:

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

This will add the two platforms in Gemfile.lock 这将在Gemfile.lock中添加两个平台

I had the same error when deploying to google cloud. 部署到谷歌云时我遇到了同样的错误。 But after running these two commands ruby and x86_64-linux were added and the issue was resolved. 但是在运行这两个命令之后,添加了ruby和x86_64-linux并解决了问题。

For Ruby 2.5.1 I solved this on my VPS by adding also the platforms mentioned in the error message to the platform list section of the gemfile.lock : 对于Ruby 2.5.1,我在我的VPS上解决了这个问题,将错误消息中提到的平台添加到gemfile.lock的platform list部分:

PLATFORMS
  x86-mingw32
  ruby 
  x86_64-linux

Only then, running following commands from app's directory (as already shown in taz's answer ) 只有这样,从应用程序目录运行以下命令(如taz的答案中所示)

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

lead to success. 导致成功。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 捆绑安装错误 - 您的捆绑仅支持平台 [] 但您的本地平台是 [“ruby”、“x86_64-linux”] - bundle install error - Your bundle only supports platforms [] but your local platforms are [“ruby”, “x86_64-linux”] 如何解决此错误:“您的捆绑包仅支持平台 [],但您的本地平台是 [“ruby”、“x86_64-darwin-19”],并且没有兼容...” - How do I fix this error: "Your bundle only supports platforms [] but your local platforms are ["ruby", "x86_64-darwin-19"], and there's no compati..." Ruby On Rails:therubyracer x86-mingw32丢失的宝石 - Ruby On Rails: therubyracer x86-mingw32 missing gems 在 Gemfile 中列出的任何 gem 源中都找不到 gem 'tzinfo-data x86-mingw32'。 (Bundler::GemNotFound) - Could not find gem 'tzinfo-data x86-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound) 无法在Gemfile中列出的任何gem源中找到gem'rail(= 4.2.5.2)x86-mingw32'或在此机器上可用 - Could not find gem 'rails (= 4.2.5.2) x86-mingw32' in any of the gem sources listed in your Gemfile or available on this machine 在您的 Gemfile 中列出的任何 gem 源中找不到 gem 'nested-scaffold x86_64-linux' - Could not find gem 'nested-scaffold x86_64-linux' in any of the gem sources listed in your Gemfile 找不到gem'rails x86-mingw32' - Could not find gem 'rails x86-mingw32' 如何在Windows上将rubygems平台从x86-mingw32更改为x86-mswin32-60 - How to change rubygems platform from x86-mingw32 to x86-mswin32-60 on windows 无法运行Rails服务器,找不到Gem'rail(4.2.5.1)x86-mingw32' - Can't Run Rails Server, Could Not Find Gem 'rails(4.2.5.1) x86-mingw32' 安装gem时如何包括x86-mingw32二进制文件 - How to include x86-mingw32 binaries when install a gem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM