简体   繁体   English

是否可以使用Windows平台开发RUBY项目? 还是应该改用Linux?

[英]is it ok to use windows platform to develop RUBY project ? or should i use Linux instead?

I am developing a website using RUBY ON RAILS ; 我正在使用RUBY ON RAILS开发一个网站; JSON for communication API's and MONGODB as the nosql database. 用于通信API的JSON和作为nosql数据库的MONGODB。 So can i go ahead win windows platform or do i need to go with Linux ? 那么,我可以继续赢得Windows平台吗?还是需要Linux? If yes .. then which one ? 如果是..那是哪一个? Please suggest the best platform for my project. 请为我的项目建议最佳平台。

I have developed with Rails on Windows, Mac and Linux so I think I have a pretty broad perspective on this. 我已经在Windows,Mac和Linux上使用Rails进行了开发,因此我认为我对此有广阔的视野。

Windows is doable; Windows是可行的; but the platform will fight you every step of the way. 但是该平台将与您抗衡。 Linux and OSX are equivalent in terms of setting up a development environment, Linux is a bit easier to get started while OSX has an advantage of a better toolset. 在设置开发环境方面,Linux和OSX是等效的,Linux入门较容易,而OSX具有更好的工具集的优势。 I prefer OSX, Linux and Windows in that order. 我依次选择OSX,Linux和Windows。

RVM alone is a pretty compelling reason to use a Unix-based OS. 仅使用RVM就是使用基于Unix的操作系统的一个非常令人信服的理由。

You need to keep in mind that windows will always be a second class citizen in the ruby (and most of open source) world. 您需要记住,在红宝石(和大多数开放源代码)世界中,Windows将永远是二等公民。 It stems from a few things, first is the lack of fork on windows, and the fundamental role it plays in unix apps. 它源于几件事,首先是Windows上没有fork,以及它在unix应用程序中扮演的基本角色。 Because of that, most of the good app servers don't work at all on windows (passenger/nginx, unicorn, thin, etc). 因此,大多数优质的应用服务器在Windows上根本无法工作(乘客/ nginx,独角兽,薄型等)。 Second big issue is that ruby gems may rely on c libraries that are un available, or difficult to install on windows. 第二个大问题是,ruby gems可能依赖于不可用或难以在Windows上安装的c库。 Lastly, due to the lack of rubyists using windows, pretty much everything is not terribly well tested on the platform. 最后,由于缺少使用Windows的红宝石专家,因此几乎所有内容都没有在平台上经过严格测试。

As a general rule of thumb, windows is great for windows development, anything else you should be using linux or osx. 作为一般经验法则,Windows非常适合Windows开发,您应该使用linux或osx进行其他任何操作。 Some platforms have better support for it then others, but across the board, things will be done for unix first with windows as an afterthought. 有些平台对它的支持要比其他平台更好,但是,总体而言,首先要在Windows上完成Unix的工作,然后再考虑Windows。

You can use Windows. 您可以使用Windows。

However, you may have a bit of trouble. 但是,您可能会遇到一些麻烦。 Most of the documentation out there assumes a Unix (Mac OS X, Linux, etc.) system, so you'll have to translate instructions (compilation, paths, etc.). 那里的大多数文档都假设使用Unix(Mac OS X,Linux等)系统,因此您必须翻译说明(编译,路径等)。

You should run the same OS on your development (ie testing by developers) server(s) as you run in production. 您应该在生产环境中在开发(即开发人员测试)服务器上运行相同的操作系统。 Failing to do this will result in bugs which only occur in production. 否则,将导致错误,仅在生产中出现。

However, you can run Windows if you like, simply run the target OS in a VM; 但是,您可以根据需要运行Windows,只需在VM中运行目标操作系统即可。 you can still use a Windows editor etc, to edit the source code. 您仍然可以使用Windows编辑器等编辑源代码。 You can use a Windows SCM system, a Windows-based bug tracking system etc, it doesn't really matter. 您可以使用Windows SCM系统,基于Windows的错误跟踪系统等,这并不重要。

Just run your test server on the right OS and it will all be fine. 只需在正确的操作系统上运行测试服务器,一切都将很好。

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

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