我正在编写一个Ruby on Rails应用程序,通常在Heroku或Linux服务器上运行,但我也需要将其部署到Windows服务器上。
该服务器是64位Win2008服务器,安装了IIS 7.0,因此通常我更喜欢使用IIS而不是在旁边设置Apache。
我只是不知道Ruby / Rails是否与IIS兼容?Gems是否可用?64位会有问题吗?
我考虑使用Ruby 1.9.1和Rails 2.3。
我正在编写一个Ruby on Rails应用程序,通常在Heroku或Linux服务器上运行,但我也需要将其部署到Windows服务器上。
该服务器是64位Win2008服务器,安装了IIS 7.0,因此通常我更喜欢使用IIS而不是在旁边设置Apache。
我只是不知道Ruby / Rails是否与IIS兼容?Gems是否可用?64位会有问题吗?
我考虑使用Ruby 1.9.1和Rails 2.3。
你一定喜欢痛苦,因为这次部署会很痛苦。我不知道这对你是否有帮助,但在我以前的工作中,我们在Windows平板电脑上部署Web应用程序(超过200个),并决定使用虚拟机VirtualBox来部署应用程序。我们在PC平板电脑上部署了一个旧的应用程序,没有使用IIS,只是用Ruby和RubyGems作为应用程序服务器,并使用Mongrel作为应用服务器和MySQL作为数据库,但使用起来并不令人愉快。
有一种方法可以通过HttpPlatformHandler在IIS8上运行RoR-由Scott Hanselman在他的文章中描述:Announcing: Running Ruby on Rails on IIS8 (or anything else, really) with the new HttpPlatformHandler
在 Windows 上使用 RoR 工作时,我会这样做:
1. Install Ruby and RoR
2. Install NginX (balancing for each thin server launched)
3. Install Thin Server
4. Create a service (on Ruby code) that run each thin server process with each affinity process (cpu0/cpu1...) for example if have a DualCore CPU it will launch 2 Thin Server (different port between those) and set affinity for each one (using PID).
5. Set a windows user with permission to do run that service (like a IIS pool and isolated process concept)
我的应用程序已经连续工作了一年以上,没有任何问题,我很满意。