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

查看:125
本文介绍了在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

EDIT 感谢最近对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>

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

推荐答案

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

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

  • 在Windows上,Ruby和Rails的速度要比在类似Unix的操作系统上慢.
  • 一些gem和库在Windows上不起作用.
  • 某些Unix-ism在Windows上不可用(示例).
  • li>
  • 社区大多使用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 小组付出的巨大努力,以下大部分建议已过时Windows上的Ruby的稳定性,兼容性和性能.我不再需要使用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. :

  • Ruby for Windows - Part 1
  • Is Windows a supported platform for Ruby? I guess not
  • Testing the new One-Click Ruby Installer for Windows
  • Still playing with Ruby on Windows
  • Chatting with Luis Lavena (Ruby on Windows)

最后一个选择的引用是:

Choice quote from that last one is:

AkitaOnRails::最明显的事情是,任何带有C扩展名且没有适用于Windows的二进制文件的Gem都将失败.尝试执行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:呵呵,那只是冰山一角

Luis Lavena: Hehe, that's just the tip of the iceberg

说了这么多,我并不觉得在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;与之相比,使用Firefox的内存约为230MB),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:

  • DEV_MEM.dump_to(:blog) (Luis Lavena)
  • Softies on Rails
  • Ruby On Windows

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

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