Would you develop on Windows?

Hello!

I’ve been developing Rails apps — for nearly three years — solely on macOS. My perception is that “everyone” develops on either macOS or Linux — not considering remote services.

So I am wondering how “easy” it is to develop a Ruby on Rails app on Windows? Do Windows tools provide good enough support for language, shell functionality, database management, etc…? Or is one better off using WLS2, or Docker?

Thanks!

1 Like

I can’t say personally, but I have been on this list since the very early days, when it was an actual mailing list (even before Google Groups, and certainly before Discourse). In that time, I can honestly say that the amount of signal/noise around Windows has been very very tipped toward Basic System Thing Doesn’t Work As Expected, and away from even Gem Won’t Compile, or Code Won’t Run. The problems seem to be foundational in nature, and getting over them just means that now you’ve graduated to the next level of difficulty.

I have seen people with far more experience in Windows than me (I mean, you would have a hard time having less Windows experience than me if you had never walked through a Best Buy in your life) try very patiently to help someone get things working at all, and often, the final message in the thread has been something along the lines of “get VirtualBox running, and install Ubuntu”.

In 2012, I taught at a weekend RailsGirls bootcamp, and we had a very slick installer for Windows called RailsInstaller or something like that. It worked about 70% of the time, and was truly magical for those people, but for those who couldn’t make it work, it was a very frustrating process with a lot of back-and-forthing, and some of those women were only able to watch over someone else’s shoulder while they did the classwork.

I am certain that it’s better now with the Linux subsystem, but how much better? Usable? Maybe the lack of complaints more recently are a sign that the worst is behind us. But I would tend to doubt it, if only because my memory is so long.

Walter

2 Likes

WSL2 is fine, we have multiple developers who work full time in Windows using WSL2

Native windows is terrible, WSL1 is bad for Rails, VMs can work

Would I develop on Windows? Maybe if I could replace the window manager and use i3 :slight_smile:

2 Likes

Sure… Ruby’s ruby, most gems work and for those that don’t, I’m confident there are workarounds.

Thanks for the insightful answer.

I remember that around 2009 I had to revert to Linux to tryout Django. I haven’t done web development on Windows since — I was using .NET & C# until then — and it’s sad to see such issues still linger, although to a small degree. VirtualBox is also an alternative, yes! I totally forgot about it. From what I’ve read online WSL2 appears to be good enough to make VB unnecessary.

1 Like

I am one of those devs Sam mentioned above, using WSL2. It isn’t hard to get started; you should really give it a shot.

4 Likes

I end up splitting my Rails development time between macOS and Windows 10 using Windows Subsystem for Linux. Scott Hanselman wrote a great blog about using WSL2 to do Rails development: Ruby on Rails on Windows is not just possible, it’s fabulous using WSL2 and VS Code. I haven’t had any problems developing Rails on WSL2. Just make sure you’re using WSL2 and not WSL1; WSL2 is much more performant for Rails development.

1 Like

Yes, that post is great! I also read it before coming here. :wink: Didn’t know about WSL until then.

I have deved on WSL1, WSL2 and virtual box (with ubuntu) on Windows and it’s doable but you will still get better performance on linux. So use WSL2 if you must use Windows but otherwise linux is more preferable.

The tll;dr is, I’d stick with Mac and I’ll even be going back to it after having been using Windows for months. Linux is also fine if that’s your flavor/budget range.

I’ve been using WSL1/WSL2 for the last few months. It works fine on my HP gaming laptop (I have a 15" HP Omen, Intel i7 that I bought in July when my early 2015 Macbook battery swelled and ruined my laptop).

I will say, for WSL1/WSL2 to work properly will be hardware dependent. I have another Lenovo laptop for my new job and it has weird issues with WSL2 that I cannot duplicate on my HP. My HP is just like a native Ubuntu installation with Bash, etc. and the plugins for VSCode to run the bash terminal right in the IDE has been flawless.

The Lenovo laptop has some special hardware specifically for “improved virtualization” performance but I’d say it’s only caused headaches.

I will say, I would have preferred to stay on a Mac but I had been trying very hard to wait until after Apple’s new silicon had come out to find out what the performance is like so I can upgrade to a MBP with the new silicon or a mac mini with the new silicon. The lack of upgrading parts on the newer macs really is a let down and made me hesitant to purchase before hand. It’s a lot of money for an i5 and 8gb of ram that can never be upgraded when just a few months away they were coming out with a revolutionary upgrade!

So what’s important to understand is that WSL2 is a fully virtualized linux kernal in the background. It’s using Hypervisor. Performance wise, I haven’t noticed any different from my early 2015 MBP to my newer windows laptops… and I think since it was a radical upgrade that the lack of performance difference is very indicative of what it takes to run a virtualized environment.

2 Likes

Sure. I’ve been developing Rails apps in windows for more than 3 years (using WSL). I must to say that I would prefer using Windows over macOS, in that you could always get a better laptop / PC running in Windows than macOS. With same price, you get a better screen, narrow bezel, and high performance!

I had tested the performance difference between my MacBook Pro with Intel i5-5257U and my Razer Balde 15 with Intel i7-8750H in 2017. It turned out that Razer Balde 15 run the rspec tests twice faster than MacBook Pro.

1 Like

So prior to opening this topic my client wanted to develop a new app on Rails. Their machines all run Windows; they want to keep development in house; and I’ve never developed (Rails) outside macOSland. Thus my initial doubts.

Almost every comment points to WSL2 as a viable solution. That’s great because it means they don’t require to get new machines; nor dual boot; nor use a remote virtualization service. So for now, that’s what we’re going with to kickoff the project.

Thank you all! :ok_hand:

1 Like

Unless you’re production env is Windows (production Windows running Rails sounds absurd but maybe somebody is doing it!), or you’re a hobbyist, doing Rails dev on Windows seems like just an exercise in solving problems that you’ll only have because of that env.

Most senior Rails devs do dev in the same env as all other envs, which means virtual box, docker etc. If somebody on my team wanted to run our application dev env on Windows I would not allow it.

Indeed! This client already has some .NET apps so I had to evaluate how one would run Rails on Windows.

I haven’t developed anything on Windows since back in my PHP days which was about 10+ years ago now. Everyone I know that does or has done Ruby dev on Windows has made it seem like a nightmare compared to Linux or Mac.

I assume it’s not as bad on Windows as it used to be due to the Windows Subsystem for Linux being available now. But, still a never for me.

Personally, I will never do any dev work on Windows. I use Pop_OS on my desktop and I have a Macbook Pro (which I do most of my work on from my bed now :stuck_out_tongue:).

Use the Ubuntu WSL and develop the app on there. Not sure how much of the .NET stuff you have to use in the Rails app, but if you can, definitely use WSL.

I did the opposite because I was worried about problems and compatibility issues with the Apple Silicon. I wanted to give it a year or 2 to iron any bugs out. Good thing about my choice is that Macbooks hold their values very well. So, maybe in another year to year and a half I will sell off this MBP and get a new Apple Silicon MBP. :smiley:

Development on windows is fine nowadays, https://rubyinstaller.org has done a phenomenal job at making up for the shortcoming of windows.

1 Like

I completely agree. On recent versions (Ruby >= 2.4) most native gems also download and compile natively without any issues. There are a few minor issues that need resolution: - some gems assume that Windows will never be supported and lack some minor points that would make them work on Windows (I have recently made PRs to a repo that needed an extra line of C code or such) - some gems need to be installed in Windows using platform:ruby so that it tries to compile the gem rather than looking for a fat gem - some gems have a couple of legacy path issues carried over from when fat gems would bundle the prebuilt binaries None of these is a show-stopper. I would recomend you do the following if you do intend to use Rails on Windows: - Download a recent Ruby (both 2.6 and 2.7 work fine as does JRuby 9.2.x) - Install ‘pik’ that allows you to switch between Ruby versions - Try to use Rails - Both VS Code and Rubymine work great on Windows - so, pick whichever meets your needs/ budget - If you run into problems, ask here or in the RubyInstaller group. We’d be happy to try to help. To double check, I just did a ‘gem install rails’ in a Ruby 2.6.6 installation. Then, I did a ‘rails new trial’ to create a new Rails project and to see if bundle works with it. I realised I didn’t yet have Node.JS on my new PC, so I went through the setup for that. Then, through chocolatey, I installed Yarn. But with all that there, I was able to get to the Rails welcome page! That much works on 6.0.3 Best Regards, Mohit.

I’am exploring VSCode on Windows and a virtual machine with Ubuntu (using Remote SSH extension). It looks a good alternative too, without the need of WSL2 enabled.

I’d strongly, strongly encourage WSL for Rails development on Windows. WSL has improved so much that it pretty much feels the same as installing it on Linux. If you happen to use Visual Studio Code, there’s even an official extension to connect VS Code directly to your WSL environment as though you were working natively. After trying Rails this way for the first time, I liked WSL enough that I use it not just for Rails, but for most of my other non-Windows-based development. I won’t claim it’s the ideal Rails environment, because it’s definitely not- but it works well enough for me to do everything I gotta do with little to no friction.

I also wouldn’t really call WSL and Docker two opposing possibilities: it’s quite reasonable to use a Dockerized (or Vagrant-ized) approach inside WSL as well (though this takes a little more trickery). Doing this gives you the benefits of containerization, as well as lets you keep the drastically better tooling of the Linux subsystem.

I’ve done all my work on Windows boxes for years. Lately I’m having zero issues developing in WSL2 and/or Docker. 100% recommend.

EDIT: Specifically, I’m using Docker with the WSL2 backend and integrated into my WSL2 machines. Docker is MUCH faster and more reliable if you are binding directories from WSL2 volumes rather than from the Windows/NTFS side.

1 Like