4 ms·
Developing Rails apps on Windows (the joyful way)
- aaronbrethorst 17y agotl;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.
- rbanffy 17y agoI 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.
- zooey 17y agoNo, 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.
- RyanMcGreal 17y agoWindows 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.
- aaronbrethorst 17y agoI 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.
- Daishiman 17y agoI'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.
- rbanffy 17y agoI 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.
- zooey 17y agoI 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.
- minouye 17y agoWent 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.
- RyanMcGreal 17y agoLast 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.
- Goosey 17y agoSerious 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.
- gcampbell 17y agoIf 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.
- bphogan 17y agoI 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.
- Goosey 17y agoGood 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..
- bphogan 17y agoHonestly 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. :)
- bphogan 17y agoRuby 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/ 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-applications 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.