有没有办法在 Windows 机器上运行 Ruby on Rails 应用程序? [英] Is there anyway to run Ruby on Rails applications on a Windows box?

查看:38
本文介绍了有没有办法在 Windows 机器上运行 Ruby on Rails 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在 VPS 窗口框上运行 Redmine,这是一个 Ruby on Rails 应用程序.我唯一能想到的就是运行虚拟 Linux 机器并从那里托管它.如果这是我唯一的选择,我会在虚拟机内运行虚拟机时遇到问题吗?

I'm looking to run Redmine, a Ruby on Rails app, on a VPS windows box. The only thing I can really think of is running a virtual Linux machine and hosting it from there. If that is my only option, am I going to run into problems running a virtual machine inside of a virtual machine?

此外,这将是一个内部应用程序,因此性能不是我曾经关心的数字.

Also, this will be an internal app, so performance isn't my number once concern.

推荐答案

Windows 不是部署生产 Rails 应用程序的常用场所,但有人这样做.Mongrel 最初的编写目的是为 Windows 提供更好的部署选项.事实证明,UNIX 部署选项也不是那么好.:)

Windows is not the usual place to deploy production Rails apps, but there are people who do it. Mongrel was originally written to give better deployment options for Windows. As it turned out the UNIX deployment options weren't that good either. :)

从 Ruby One Click 安装程序开始,这样您就可以正常安装 ruby​​ 和 ruby​​gems.

Start with the Ruby One Click installer so you have a sane installation of ruby and rubygems.

从那里,您可以像往常一样为您的数据库安装 rails gem 和 gem.大多数(如果不是全部)数据库都有 Windows gems.

From there, you install the rails gem and the gem for your database like you normally would. Most if not all of the databases have Windows gems.

确保安装 mongrel_service 以便能够像普通 Windows 服务一样控制每个 mongrel.详情参见 mongrel_rails service::install -h.

Make sure to install mongrel_service to be able to control each mongrel like a normal windows service. See mongrel_rails service::install -h for details.

设置好杂种后,它类似于 UNIX 部署.你设置了一个反向代理,比如 Apache2,你就设置好了.

Once you have your mongrels set up, it's similar to a UNIX deployment. You set up a reverse proxy, such as Apache2 and you're set.

您可能会遇到一些在 Windows 下无法运行的 gem(例如 BackgroundRB),因为它们具有 C依赖于 UNIX 库或在安装时期望类似 UNIX 的构建系统的代码.然而,所有真正重要的 Rails gem,例如 Mongrel 和数据库适配器,都有带有预构建二进制文件的 gem,所以你会没事的.

You might run into some gems (such as BackgroundRB) that will not work under Windows because they have C code that either rely on UNIX libraries or expect a UNIX-like build system at installation time. However, all of the really important Rails gems, such as Mongrel and the database adapters, have gems with pre-built binaries available, so you'll be fine.

这篇关于有没有办法在 Windows 机器上运行 Ruby on Rails 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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