在 Windows 上运行 Ruby/Rails 的限制 [英] Limitations in running Ruby/Rails on windows

查看:28
本文介绍了在 Windows 上运行 Ruby/Rails 的限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 RoR 的安装文档中,它提到在 Windows 上运行 Ruby on Rails 有很多限制,在某些情况下,整个库都不起作用.

In the installation documentation to RoR it mentions that there are many limitations to running Ruby on Rails on Windows, and in some cases, whole libraries do not work.

这些限制有多严重,我是否应该始终默认使用 Linux 来编码/运行 RoR,Iron Ruby 是否有望修复这些限制,还是它们是操作系统本身的核心?

How bad are these limitations, should I always default to Linux to code / run RoR, and is Iron Ruby expected to fix these limitations or are they core to the OS itself?

EDIT 感谢有关在 Linux 上安装和运行的回答,但我真的很想了解安装文档中引用的功能限制,而非 -工作库 - 我试图找到评论的链接,但是当我安装我认为的 msi 包时,它在安装中被引用了

EDIT Thanks for the answer around installation and running on Linux, but I am really trying to understand the limitations in functionality as referenced in the installation documentation, and non-working libraries - I am trying to find a link to the comment, but it was referenced in an installation read me when I installed the msi package I think

编辑感谢最近对 IronRuby 的引用,它当然是一个值得关注的项目,而且显然它是一种 .NET 语言,如果它兑现了承诺,它将是无价的.然而,最终,就我而言,我只是硬着头皮安装了一个 Ubuntu 服务器.

EDIT Thanks for the references to IronRuby lately, it is certainly a project to watch, and as it, obviously, is a .NET language, it will be invaluable if it lives up to the promises. Eventually, however, in my case, I just bit the bullet and installed an Ubuntu server.

<偏差>我几年前就应该这样做了</bias>

<bias> I should've done it years ago </bias>

推荐答案

以下是 Windows 上 Rails 当前问题的概述:

Here's an overview of the current issues with Rails on Windows:

  • Ruby 和 Rails 在 Windows 上比在类 Unix 操作系统上慢.
  • 一些 gem 和库在 Windows 上不起作用.
  • 某些 Unix 主义在 Windows 上不可用(示例)..莉>
  • 社区主要使用 Mac 或 Linux(这是一个特别难处理的问题;当部落的其他人在聚会、玩乐和相处时,没有人愿意独自一人在一个岛上在另一个岛上.社区很重要.似乎大多数从 Rails 开始的 Windows 开发人员很快切换到 Mac 或 Linux.然而,坚持不懈的 Windows Ruby 用户小社区非常友好,敬业且知识渊博 - 打个招呼.)
  • Ruby and Rails are slower on Windows than they are on Unix-like OS's.
  • A few gems and libraries don't work on Windows.
  • Some Unix-isms aren't available on Windows (examples).
  • The community is mostly on either Mac or Linux (This is a particularly hard one to deal with; nobody wants to be alone on one island when the rest of the tribe are partying, having fun and getting along great over on the other island. Community is important. It seems that most Windows developers that start with Rails quickly switch to a Mac or Linux. However, the small community of Windows Ruby users that do persist are extremely friendly, dedicated and knowledgeable - go say hi.)

请注意,由于 RubyInstaller 团队在带来Ruby on Windows 的稳定性、兼容性和性能.我不再需要使用 VirtualBox,这说明了 Windows 上的 Ruby 已经走了多远.

Note much of the advice that follows is now outdated due to the magnificent efforts of the RubyInstaller team in bringing stability, compatibility and performance to Ruby on Windows. I no longer have to use VirtualBox, which says a lot about how far Ruby on Windows has come.

如果您想了解更多技术细节,请阅读以下内容.:

If you want more technical detail, the following are required reading. :

最后一个的选择引用是:

Choice quote from that last one is:

AkitaOnRails: 最明显的一点是,任何带有 C 扩展的 Gem 没有合适的 Windows 二进制文件都会失败.尝试执行 shell 命令将失败,RubyInline 也会失败.还有什么?

AkitaOnRails: The most obvious thing is that any Gem with C Extensions without proper binaries for Windows will fail. Trying to execute shell commands will fail and RubyInline as well. What else?

Luis Lavena:呵呵,这只是冰山一角

话虽如此,我并不觉得在 Windows 上使用 Rails 开发痛苦.在大多数情况下,使用 Ruby 是一种乐趣.我会避免使用 InstantRails,因为坦率地说,使用一键安装程序正确安装 Ruby 一样容易,然后执行 gem install rails.如果您需要 Apache 和 MySQL,WAMP 是一个不错的选择,尽管如果您坚持使用,即使这些也不是必需的杂种和 SQLite.

Having said all that, I don't find developing with Rails on Windows too painful. Using Ruby is, for the most part, a pleasure. I'd avoid InstantRails because, to be frank, it's just as easy to install Ruby properly using the one-click installer, then doing a gem install rails. If you need Apache and MySQL, WAMP is a good bet, although even these aren't required if you just stick with Mongrel and SQLite.

我最近在做的是运行 VirtualBox 和一个 Ubuntu Server 实例,它密切反映了部署服务器.我将网络驱动器映射到 Ubuntu 服务器,然后直接在 VM 上编辑和运行我的代码.它几乎不使用任何内存(它目前使用~43MB;与使用~230MB 的Firefox 相比)并且Rails 实际上比在Windows 上本地运行它的性能要好.此外,您可以相对安全地试验您的虚拟服务器.这是一个非常好的设置,我强烈推荐它.

What I've taken to doing recently is running VirtualBox with an instance of Ubuntu Server that closely mirrors the deployment server. I map a network drive to the Ubuntu Server, then I edit and run my code directly on the VM. It uses hardly any memory (it's currently using ~43MB; contrast that with Firefox, which is using ~230MB) and Rails actually performs better than running it natively on Windows. Plus you can experiment with your virtual server in relative safety. It's a really nice setup, I highly recommend it.

最后,这里有几个针对 Windows 用户的 Ruby/Rails 博客:

Finally, here are a couple of Ruby/Rails blogs aimed at Windows users:

这篇关于在 Windows 上运行 Ruby/Rails 的限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆