Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Developing Rails apps on Windows (the joyful way) (factore.ca)
8 points by adriand on April 15, 2010 | hide | past | favorite | 23 comments


Ruby certainly can do SQLite3 on Windows, quite well under 1.8.6 and 1.8.7, but as the article's author notes, it's just troublesome under 1.9. (But enough other stuff doesn't work quite right in 1.9 yet either anyway.)

The setup for dev on Windows is pretty simple as you can see from

http://napcs.com/howto/rails/windows/

As it stands now, with the latest installer for Windows, Rails development is quite possible. Msysgit works fine, SQLIte, Rails, all of it works great, it's just slower.

In fact, I've been using Windows for Rails dev for nearly 5 years - I'm even crazy enough to have deployed production apps on Windows servers. (out of necessity, not out of choice, but it's a neat skillset to have, and I was able to contribute a chapter on Rails + Windows to http://pragprog.com/titles/fr_deploy/deploying-rails-applica... which, oddly enough, is still relevant.)

HOWEVER, I will state that if you're looking to truly leverage Ruby, nix is the way to go. A VM like this works great, but I also recommend two pieces:

Putty to act as your console * SAMBA on the VM so you can have a share.

I used a setup like this for a while for LAMP development before I started doing Rails.


Serious question here. I come from a game industry background and am /very/ comfortable and productive in a Windows environment. However, I have recently setup my system to dual-boot into Ubuntu largely because I am serious about entering the world of web development and my impression is a *nix core is a must (either OSX or linux).

I am finding the learning curve to be rather steep, but I have prepared myself to pull through and come out the other side a Linux guru.

The question is this: Am I doing it wrong? Given that I am already comfortable and productive in Windows.. is it idiotic of me to try to force my square peg into a round hole? Should I at least go the middle-ground and use a VM so that my 'normal computing' is in my familiar environment and I can just drop into Ubuntu for testing/deployment?

One last bit of context: I am bootstrapping a web startup in my evenings so time is rather premium. My day job is still windows centric so context-switch issues might occur.


Honestly I think there are many benefits to Linux especially if your plan is to work on Python or Ruby development. If you're looking to do C# stuff, Windows is gonna be better. When it comes to a lot of open-source languages, Windows is kind of an afterthought, and while it often works, the non-Windows solutions end up being faster, and more likely what you see when you deploy your apps. It can help greatly if your dev platform mimicks your production platform, but it's not necessary.

I just taught a day long Ruby / Rails class in Feb and we had Windows users mostly, with some Mac and Linux folks too, but we all deployed to Heroku.com without issues.

My advice is to use what makes you productive now. Learn many things, but learn them one at a time or you'll frustrate yourself. Switch from Windows to Linux when Windows starts slowing you down if that makes you more comfortable.

Programming should be fun. :)


Thanks for the advice. I am planning to use a Python/Django/MySQL/nginx/EC2 stack initially.


We have a very similar situation and here are my experiences.

- Command line will give you the most bang for your buck every single time. Learn one small thing at a time and build upon it, you will be amazed at how much more productive and quick you will become from understanding simple commands.

- Start using Vim/Emacs. Doesn't really matter which one, the gains from using a powerful editor will (in the long run) pay for them selves.

These editors combined with the command line have shown the greatest gains in my productivity.

Now that said learning the editor will be up hill for a good chunk of the time until it clicks, so it may make sense to use something like geddit in the mean time.

There is no magic bullet with any sort of Development. Using unix like systems isn't going to make your website better or you more productive if you don't actually take some time and learn it. If you come over to Ubuntu but only use the GUI you will likely loose productivity.

Besides who cares what you write your site in as long as you -write- it.


Thanks for sharing your experiences. I have found I really _enjoy_ doing work from the command line. It just feels natural even if I am still reaching to my "How Linux Works" book every 2 commands. :)

I suppose right now a much more difficult thing for me is coming to grips with more fundamental differences in the OSes. For example, if I install a program on windows it goes into /Program Files/ and I know how to interact with it. If I apt-get in ubuntu its often unclear to me where to modify it's configuration, how to launch it, etc. This is best illustrated by the 4 hours I burned getting nginx up and running.

I am certain that this is just me not being used to the conventions but.. Well I don't know what my point is, honestly I think I am just venting now. :)

edit: Question on the VIM/Emacs suggestion. I started dabbling in VIM, but as a long time VS.NET user (I can navigate through a visual studio environment like a fish through water) it just felt.. Small. I assumed I would be better off going to an IDE (I am using python, so there are plenty to choose from). Do you have any comments on this? Is an IDE a 'drug' I could benefit from learning to break off?


I'm a .NET dev by day and a Rails hobbyist by night, but I agree with the prior comment regarding learning Vim or Emacs. I can relate to your experience with it feeling small in comparison to VS, but there are tools out there (ViEmu, VsVim) that will let you use the Vim knowledge gained in VS and it will make VS better. I started learning Vim a couple of years back and it was the best decision I made.

If you choose Emacs, I believe VS has Emacs key-binding support built in.


The nice thing about linux is that it IS an IDE. With built in tools its easy to do much of the heavy work VS does. I also use VS at work and its very refreshing to use simple but extensible tools. VS takes forever to load and none of the tools work half as good as the cmd ones.

VIM is just an editor with advanced editor tools. If you are looking for more of a IDE emacs really follows that path. Its highly extensible and has many more IDE type features.

Again using an IDE is fine and dandy if you ship things. :)


If you have the spare RAM, I'd say a VM is the way to go. I've tried the dual-boot approach, and found that the annoyance of having to reboot to switch between environments was high enough that it usually deterred me from doing it at all.


I would agree with this, but also, snapshots are great. If you goof up your VM, just revert :) Great when learning how Linux works, and much faster than a wipe and rebuild.


Good point about the snapshots! Also given that getting the dual-boot setup correctly with Windows 7 and my "FakeRAID" hard drives already consumed a weekend I wish I had thought of the VM route sooner..


uhm but people using your webapp won't know/care the way you built it (tools/language/OS), so if the time is so precious to you and other than for learning new things (that is always good, I don't say the contrary), why are you using linux instead of windows to develop your software?


I switched to Ubuntu as my main OS a few months ago. I still run a WinXP VM so I can run a few windows apps and Photoshop. It's an ideal situation, I definitely recommend it.


Last year I revived an old, underpowered Windows box by wiping the hard drive and just installing Ubuntu straight-up. Aside from the dramatic speed-up in performance, I can state from experience that Ubuntu is definitely wife-friendly - it was a smooth and painless transition for my not-nearly-as-geeky-as-me life partner. (It helped that we had already been using mostly free software even on Windows.)

As for git on Windows, I've found Msysgit to be a lot faster and more stable than git on Cygwin. You can also configure it during installation so that git commands work on the CMD command line, which is marginally less bad than Msysgit Bash.


tl;dr version: The 'joyful way' to develop in Rails on Windows is by installing Linux in a VM on the machine (and then developing in that). No seriously, that's the author's argument. Can't say I disagree, though.


I have been using Cygwin to develop for Django, combined to native Windows Emacs. It works, but I would not call it joyful.

Obviously, I never noticed Ruby can't do SQLite on Windows. I find that somewhat weird, as Cygwin appears to hide Windows very well and has its own builds for Ruby and SQLite (I use Cygwin's Python instead of win32 Python.

At first, I was considering to congratulate the author for being able to use "developing", "on Windows" and "joyful" in the same sentence.


No, really, all you anti-microsoft what kind of programming "job" experience do you have to say that M. is so bad? Mac is better? Linux? Really? And for what?: I mean real job experience where you are paid by somebody to do something not just working on your own secret project.They are just tools.It's 2010.Grow.


Windows can be a good platform for developing software, as long as you're using IDEs to develop applications targeted at Windows machines. For example, Visual Studio + SQL Server is just fine for building .Net applications that run on Windows.

For everything else - and "everything else" includes large swaths of lucrative, profitable programming activities, including something like two-thirds of the internet - Windows is simply excruciating. I'm not exaggerating; after spending the past year or so developing on Ubuntu, I don't know how I managed to get anything done before.

The Windows command line is minimally usable (I have to right-click on the window frame to pull up a context menu that provides select/copy/paste functionality? Really?) and its language is minimally powerful (I understand powershell improves significantly on this).

Unless you're moving files around a Windows network, in which you can map drives in Explorer, such basic network things as FTP/SFTP require clumsy third-party GUI applications and your choice of FOSS options is severely limited. SSH requires a clunky third-party tool like PuTTY or a Posix emulator like Cygwin.

Native support for open source database servers like MySQL, Postgres, and SQLite is dodgy at best and requires bolted-on interfaces. More exotic, innovative database systems are generally out of the question altogether.

Some programming languages, like Python, are reasonably cross-platform (though in the case of Python you're still stuck with a choice between using the crappy Windows command line or the slightly-less-crappy IDLE IDE built in non-native Tkinter), while others are much harder to get working.

Java is fully cross-platform and has IDEs that work as well on Windows as any platform, but there's no particular reason to develop Java on Windows rather than another OS.

It's true that installing Cygwin makes a lot of the deficiencies of Windows go away - but that's by emulating a Posix environment such as you'd find natively on Linux or OSX, which is kind of the point about Posix being generally a much better platform for programming than Windows.


I firmly believe in using the right tool for the job.

I worked at Microsoft on the Visual Studio team for four years. I love Visual Studio. Visual Studio is awesome. That doesn't change the fact that I (and lots of other people) firmly believe that writing Rails applications on Windows is a miserable experience.


I'll bite. I've worked several years doing .NET and web development. Sure, desktop Windows development with C# in Visual Studio is a really, really nice experience.

But shoot me dead if I ever have to do a real, actual, useful, standards-compliant website in Windows with Visual Studio. I'll take me screen, shell, Vim, Python, and SSH over it any day.


I know I shouldn't feed trolls but I also feel I should clarify some things.

I started developing software professionally about a quarter of a century ago, on Apple IIs using the built-in BASIC, 6502 machine language and assorted toolkits for graphics and animation. For a long time, I used Microsoft technologies, from Actor (a Smalltalk-like environment that ran on Windows) to Visual Basic, Visual C++ (mostly for WinCE) and assorted MS web technologies. I also did a lot of web stuff on Unix platforms at the same time. It was not until 2002 that I made my switch to Unixes complete. Unless you develop for Windows, it makes little to no sense to develop on Windows and, as far as you are comfortable with other platforms, it makes little to no sense to deploy to Windows. It's expensive, not particularly predictable and the hood comes soldered. Not a good thing on a server.

In fact, I like to develop on a platform as close as possible to the deployment platform. It makes a lot of sense.

Development stacks are tools. All I implied was some are much more refined than others.

With time you'll learn.


I use a text editor, a shell, other tools. The idea that I want to fight is that linux is a far better environment or mac is far better than windows. I mean, just use what you want, but when you say "x" is better is just because (usually) you are mixing personal like/dislike with ideology (and in the IT community there is a lot of ideology: just think about apple...). I don't care about Microsoft, and all these talks about "the tools" are all right until a certain point. Some times, I've to be honest, seems like talking with kids. I mean really you need ubuntu to do a good job? Maybe developing rails is a far better experience on linux for some reasons I don't know (I'n not a rails develoepr): so you'll use linux. People use linux as a server because is a unix-like platform costing no money. It's better than microsoft server. Good for them and for me because I also use linux. I use windows because I'm used to this platform, I need some tools are just on Windows and I don't like too much the Apple OS. But I've to be honest, I don't like also Steve Jobs and the ideology that Apple brings with its cult. So I'm religious as you. The important thing is to be aware of why you think in a certain way and why you take certain decisions. Tools are tools are tools.


Went through the same experience--Ubuntu (via VirtualBox) on a Vista machine saved me from pulling all of my hair out. If you have plenty of memory to play with, certainly the way to go.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: