如何在 Windows 服务器上安装 mongrel/rails 的 service_wrapper?
我接到了一项令人不快的任务,要安装我在 Windows Server 2008 上编写的 Rails 3 应用程序(这绝对不是我的选择 - 承诺提供 Linux 服务器,但 IT 在最后一刻撤回了,所以请不要建议进行更改)环境作为解决方案)。
我按照这篇博文上的说明进行操作(进行了一些小的修改),现在经过一番挫败之后,我的应用程序实际上已经在 Windows/IIS(代理杂种)下启动并运行了。剩下的唯一一件事就是让 mongrel 作为服务运行。
不幸的是,Rails 3 的 mongrel gem 尚未保持最新,虽然我可以在命令行下让应用程序在 mongrel 下运行,但我无法使用 mongrel_service 让应用程序作为服务运行。
解决方案似乎是使用 github 上的 service_wrapper 项目,该项目已在 这之前问题。该项目尚未完成,但显然可以正常运行,但没有文档/二进制文件。我查看了源代码,但并不真正理解它是什么/它是如何工作的,所以想知道是否有人可以为我指出正确的方向(或者更好的是,引导我完成如何安装)来安装它。
如此接近,却又如此遥远......
I have been given the unpleasant task of installing a Rails 3 app I have written on Windows Server 2008 (definitely not my choice - was promised a linux server but I.T. pulled the rug out at the last minute so please don't suggest a change in environment as a solution).
I followed the instructions on this blog post (with a few minor modifications) and now actually have my app up and running under Windows/IIS (proxying mongrel) after a great deal of frustration. The only thing remaining is to get mongrel running as a service.
Unfortunately the mongrel gem has not been kept up-to-date for Rails 3 and while I can get the app running under mongrel at the command line I am unable to use mongrel_service to get the app running as a service.
The solution to this appears to be to use the service_wrapper project on github which has been mentioned in this previous question. The project is not yet complete but apparently functional but comes without documentation/binaries. I have looked through the source-code and don't really understand what is it/how it works so was wondering if someone can point me in the right direction (or, even better, walk me through how) to get this installed.
So close, yet still so far.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我已经解决了(在路易斯拉维纳本人的帮助下 - 谢谢)。
从 https://github.com/luislavena/service_wrapper/downloads 下载 service_wrapper-0.1.0-win32.zip< /a> 并从 bin/ 中提取 service_wrapper.exe。我将其解压缩到 C:\service_wrapper。
接下来设置一个配置文件。我使用了 hello 示例并针对我的应用程序对其进行了修改,然后将其放置在 C:\service_wrapper 目录中。
现在只需使用以下命令创建服务
(注意 binPath= 和 start= 之后的空格。没有它们,它将无法工作)
然后使用以下命令启动它
,您就到家了!
Alright I have this worked out (with a little help from luislavena himself - thanks).
Download service_wrapper-0.1.0-win32.zip from https://github.com/luislavena/service_wrapper/downloads and extract service_wrapper.exe from bin/. I extracted it to C:\service_wrapper.
Next set up a configuration file. I used the hello example and modified it for my app then placed it in the C:\service_wrapper directory.
Now just create the service with
(watch for the spaces after binPath= and start=. It won't work without them)
Then start it with
And you're home and hosed!
由于这篇文章,我应该做出贡献。对于使用bundle exec的配置,请使用以下命令:
请注意,我正在设置 rubyCAS!这是一个很棒的 OpenCAS 身份验证机制!!!
I ought to contribute due to this article. For config of using bundle exec, use the following:
Note that I am setting up rubyCAS! it's a great OpenCAS authentication mechanism!!!