简体   繁体   English

如何在Windows上安装Linux Rails gem

[英]How to install a Linux Rails gem on Windows

I need to upload vendorize a gem which is causing problems at my host - in this case nokogiri. 我需要上传供应商销售的宝石,这会在主机上引起问题-在这种情况下为nokogiri。 My host is using linux, my development system is windows. 我的主机使用linux,我的开发系统是Windows。 The gem contains binaries and so my local gem downloads the win32 binaries. 该gem包含二进制文件,因此我的本地gem下载win32二进制文件。 Is there any way I can get gem to download the linux binaries, so I can vendorize and upload them? 有什么方法可以让我下载gem来下载linux二进制文件,以便可以将其销售并上传?

You won't be able to build the Linux version of a gem on Windows. 您将无法在Windows上构建gem的Linux版本。 That's why there are multiple platform versions for some gems. 这就是为什么有些宝石有多个平台版本的原因。

You could download the original source of the Linux version, then simply store that in your repository, if you really want to have a copy of it with your app. 您可以下载Linux版本的原始源代码,然后直接将其存储在存储库中(如果您确实希望在应用程序中拥有它的副本)。

Or you could do all your development in a Linux virtual machine in your Windows box - then you'd have no vendoring problems. 或者,您可以在Windows框中的Linux虚拟机中进行所有开发-这样就不会出现供应商问题。

Other than that, don't think you can do it. 除此之外,不要以为可以做到。

Try below command 尝试以下命令

gem install YOUR_GEM_NAME --platform=mswin32

example

gem install hpricot --platform=mswin32

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM