David
David

Reputation: 300

Ruby on Rails development on windows

I've been planning on developing a rails project on windows. I've heard that the framework wasn't tested on windows (at least not the testing framework)

does anyone have any real experience with rails on windows? are there any known bugs when running on windows? does the testing framework work on windows?

Upvotes: 17

Views: 7050

Answers (6)

xiamx
xiamx

Reputation: 7030

I've tried 5 different ways to setup Rails development environment on Windows.

These includes virtualized Linux environments, Windows subsystem for Linux and alternative Ruby interpreter like JRuby. Rails on Ruby MRI works relatively well, but certainly there are gems that build native extensions that cannot be compiled on Windows. Depending on which gems your project requires, you might have a easier time.

I've got a short comparative write up here http://cs.mcgill.ca/~mxia3/2018/02/18/Five-different-Rails-development-environment-on-Windows-10-and-their-pros-and-cons/

Upvotes: 1

Manuel van Rijn
Manuel van Rijn

Reputation: 10305

I prefer developing Rails with the help of Vagrant and some Chef cookbooks to create a virtual machine where I run my Rails code on. This solves the problem with some gems not working on Windows and seems to be faster. Here's a post a wrote how I got this working

Upvotes: 1

dontangg
dontangg

Reputation: 4809

I've been developing a Rails website on Windows & Mac (depending on where I am at the time) for a few months now and, in general, I haven't run into to many problems. Here's what I know:

The new Ruby 1.9.3 installer for Windows is nice because it comes with RubyGems (which a vague memory tells me was difficult before). That's what I'm using. I haven't been able to get the ruby-debug19 gem to install correctly on windows. So, I just comment that out in my Gemfile on my Windows computer. Other than that, I haven't had any issues.

With that said, however, I love developing on my Mac so much more than I do on Windows. I haven't found an editor that I love for Rails development on Windows (currently using Sublime 2 or Notepad++ with Explorer plugin), using Git is not as nice on Windows, and I just really don't like the Windows Command Prompt (I know there are other options, but still).

Upvotes: 9

Daniel Lopez
Daniel Lopez

Reputation: 3391

I would not use Ruby on Rails on Windows for a production website, but it is commonly used for development, in particular by designers that need to work with RoR teams. We developed and use internally with our designer guy Rubystack, which is a free, all-in-one installer that setups a Rails development environment in just a few minutes.

Upvotes: 0

carols10cents
carols10cents

Reputation: 7014

I have been developing on Windows using Ruby (currently 1.9.2), Rails (both 2.3.x and 3), Rspec (1.3 and 2), Cucumber, Capybara, selenium-webdriver, sqlite3 for a few years now, and it all works most of the time. The company I work for deploys a Rails app on Linux and Windows along with our other piece of enterprise software.

That being said, I do run into weird issues a lot. I'm now trying to blog about them so that they're googlable and, eventually, I'm trying to learn how to fix them. Ruby Windows support has improvements to be made, for sure, but no one will bother fixing them if no one is using Ruby on Windows!

Definitely use the RubyInstaller. Luis Lavena, one of the main contributors, is really nice and responsive on the RubyInstaller mailing list and twitter.

Upvotes: 0

Scott
Scott

Reputation: 17247

I have recently been working with another developer that has been developing on his Windows laptop. He's been using the same tools and Rails 3 codebase as myself (I'm on Mac OS X).

He has had a number of blocking issues that have wasted many hours of his time - for example he hasn't been able to run any of our RSpec tests, and some Rake tasks.

Getting the environment setup is a pain, and even when you do, it's stressful because you never know when you are going to hit the next bizarro Windows-only bug. The reality is that Windows is a rare OS among Rubyists, and even if that wasn't so, the Rails framework developers themselves are UNIX-oriented, so there is an order of magnitude less scrutiny given to testing and development on the platform.

What's more, many of the sweet tools in the Ruby world are command-line and they work better in a real POSIX shell.

My co-worker has now bought a MacBook, and is enjoying a smoother development experience again.

But you don't need to buy a Mac; You would do just as well with dual-booting into Ubuntu (Or similar) on your existing laptop.

Upvotes: 6

Related Questions