Development on Windows

(Andrew Brown) #1

I tried downloading the source code to do a little poking around, but was unable to do so on Windows. I ran in to problems trying to install the hiredis gem. Apparently it is known not to work on Windows. For now I’m just going to set up a virtual Linux dev environment, but is this ever going to run on Windows? What if someone wanted (for whatever reason) to run this on a Windows server?

Install and setup discourse on Windows server
Performance on Windows Server 2008 R2
(Ben Doerr) #2

From what I’ve seen before, developing with ruby on Windows can be pretty bumpy.

(Jeff Atwood) #3

Ruby on Windows is … decent, but the reality is that it’s always going to be a second class citizen. It’s one of those “swimming upstream” things where you can do it, but… should you? Is it really worth it? Maybe the water is flowing in that direction for a reason! :wink:

So I’d definitely recommend a Linux VM, Ubuntu VM is what I have set up on Windows 8.

(Why not?) #4

10 years ago, I would have had the same questions you did (except about Windows server; I’ve never used Windows on a server, and I never really saw the point of doing so).

These days, Virtualbox etc. has pretty good emulation, and machines have enough RAM to support them. Why can’t you use a VM?

(Ted Lilley) #5

That’s my experience with Rails development on Windows in general. I’ve been doing it for a couple years now with Spree commerce. I have to say that Rails on Windows is simply a squarish peg busily being whittled down for a round hole. It’s just not there and my fear is that it will always feel like that. What’s more, the community support for third-party gems on Windows is tepid. It’s just hit-or-miss, and more miss than hit.

I say this after having successfully deployed a production ecommerce site with Rails on IIS 6. After exhausting my patience, I retooled it for Linux six months later. I immediately wished I’d used Linux from the start, for development as well as deployment. If you work really hard and you get really lucky, Rails on Windows can be done in some cases. It’s just sucky and partly broken in important ways (speed for one, which comes down to issues in the Ruby file I/O implementation on Windows).

While they’re trying to work on these things in the Ruby community, there’s just not a lot of enthusiasm for Windows. And with Linux being free, working great and already established as the server infrastructure, you expend less effort learning your way around the Linux environment than you do trying to jam your app into the Windows environment. It’s like a moment of zen when you stop trying to fight it.

Virtualizing your development environment is really the way to go. While I usually favor VMware, in the case of Ruby development, Vagrant has won me over and it’s VirtualBox-based. I won’t make a long case for Vagrant here, but if you haven’t seen it, it works pretty well on Windows. It’s great firing up a new, freshly-installed vm with all of the prereqs in a single command.

I’m working with this stuff every day now and when I have a minute to document what I’m doing, I write it on my blog. There are some “gems” (not the Ruby kind) in there on how to integrate Vagrant with Dropbox and how to work with the Spree commerce framework on Vagrant. Hopefully someone can get some use from it.

That’s my $.02. :slight_smile:

Edit: Here I am extolling the virtues of Vagrant etc, blithely unaware that the team at Discourse is way ahead of me and have been using it to bootstrap developers from the start. Silly me, preaching to the choir. :smile:

(Dskraus) #6

Holy crap. I haven’t deployed anything to serious on Rails and I’ve only deployed to Heroku which abstracts away pretty much everything but I’m really curious as to why you would attempt to run it with IIS6. Lots of existing servers already?

(Ted Lilley) #7

We’re a Windows shop, so for a Rails app to be maintainable here it needs the help of our server staff, who are all Windows guys. Once the app was deployed and proven, it was a lot easier to make the case that it runs better on Linux. It might not have been deployed if I’d had to make that argument up front.

Our front-end proxy is still IIS 6, using IIRF as the proxy module. It runs fine, and I don’t have to worry about things like reinstalling SSL certificates which periodically expire. The server guys can handle that and let me focus on development.

I have to maintain the Linux deployment server, but that’s not much trouble.

(Chris Thorn) #8

Are there any particularly helpful resources/documentation about deploying Rails to IIS? I’ve had a few people ask me about it before, saying they were having difficulties finding anything. I know nothing about IIS, so I couldn’t contribute at all, but it would be nice to have something to point them to in the future (especially future Windows users viewing this post).

(Dskraus) #9

That sounds reasonable and what I figured. It’s always a matter of convincing the higher ups isn’t it? :smiley:

(brad) #10

Would Python/Pylons been a better choice if Discourse was meant to be easily deployable to most web hosts? I know Pylons works (mostly) with IIS, but have never tried Rails. I still agree with the choice to not use PHP even if it means not being able to run Discourse on Windows Server.

(Sam Saffron) #12

A spammer just necroed this so I might as well link to

Been using windows for the past 5 years, so do many other core team members

I do not recommend vagrant cause none of us keep it up to date