Should I give up on deploying Rails under Windows?

给你一囗甜甜゛ 提交于 2019-12-02 03:14:37

This doesn't directly answer your question but personally I'd bite the bullet and move to Linux, install Apache and Passenger and go with it like that. Installing Ubuntu Server and installing the aforementioned is a pretty painless experience and you should be up and running within an hour or two at most.

In the past, this is the approach I've used and really the only barrier to this would be the learning curve if you don't have much/any experience with Linux and/or Apache. It might be worth checking out the "Linux for Softies" series on TekPub which cover setting up this very stack.

Give up on Windows.

Two years ago, when I also considered myself a "Windows guy," I started fooling around with Ubuntu on a spare laptop. After about two days I realized how many unnecessary headaches I had been living with on Windows, and I decided to switch.

It took some time to get everything set up comfortably, but I estimate that this switch has saved me 6 months of productivity in just these past two years. The positive impact on my quality of life is significant: installing languages and web development libraries takes a fraction of the time it did on Windows, and I can use pretty much anything out there, meaning I'm learning more, and having more fun.

I know it's a big change, but if you have a spare computer I'd highly recommend giving it a shot. There's always some way to get things working on Windows, but you should really question if its worth the effort.

Chiming in. When I had to deploy on Windows, I used VirtualBox with Ubuntu. Works well for most typical websites. You'll probably run into scaling issues pretty soon if it's a bigger site, though.

Glassfish with jruby works great on windows- and it can handle multiple requests.

Mongrel is still a valid option but passenger (mod_rails) is far more popular.

You can try to use Webrick which comes as a standard with rails.

script/server webrick

To force the use of Webrick

But If I were you I would install a virtual box on my computer, with a shared folder (given than you want to stay on windows) and use the virtual box to run my app using mod_rails

Don't give up. Mongrel is still fine on Windows and Windows is still a good development environment for Rails. Looking through the linked problem you mentioned, the guy solved his problem by uninstalling the mongrel_service gem. If you don't need to run mongrel as a service, and I guess you wouldn't on your development box, you should be fine. I don't know what version of mongrel_service you are running, but it would be worth seeing if you can upgrade.

If you must do something on Windows, then I would go with JRuby and a Java app server (like Glassfish or Tomcat). I wouldn't try to go with any native Ruby on Windows - in my experience it's just a big headache. Also Matz has admitted that on Windows Ruby runs significantly slower (I think he said almost 20 times slower) than it does on Unix/Linux. Now this likely isn't the case for JRuby, which again is why I'd recommend it for Windows.

Just my 2 cents.

I know that it's been a while, but thin now compiles on windows, if you use the --pre argument.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!