views:

919

answers:

11
+1  Q: 

Rails & Windows

Is Rails development really this hard on Windows? I'm a PHP developer looking forwards to using Rails (mainly because every single PHP framework I've tried has some quirk that I just hate).

I downloaded Aptana Studio (w/ RadRails) as it seemed to be a good solution (and because I love anything Eclipse-based). But that's where the problems begin - upon creating a project (called "test", using sqlite3), the first problem I hit is some "sqlite3 is missing" error. So I Google around a bit and install sqlite3-ruby with gem. I still got some error - but somehow managed to fix it. So it seems to work, but is this really it? Some environment that barely seems to work and has a lot of problems (see this)?

In some other question, I saw the suggestion to run the project in a VM instead and edit it from Windows. Sounds like a good idea - but the two major Rails IDE's (RadRails, NetBeans, unless there's more) seem to want to run their own server in Windows. What would be the best setup for them/how would I set up a project in them if I'd run a Linux Rails stack in a VM instead?

Note that I'd rather not work without an IDE - upon trying one for PHP, I instantly became completely dependent (sigh) on them - and since I've never really used Ruby (or Rails) before, having code completion would be a major help.

So what are your suggestions? Run in Windows or Windows & Linux stack in VM? Any other tips?

Thanks!

+3  A: 

My advice to get started is to purchase Agile Web Development with Rails and use it like a tutorial, just following along with the book. If you have a Windows machine just use that. Make sure you have a text editor that you like. This should get you going and from there you can make more informed decisions about IDEs and the like.

Andrew Cowenhoven
A: 

I've used Aptana Studio with RadRails for a while now and have become quite used to it. I remember it requiring a little effort to get running smoothly, but I still develop several apps (large and small) using the IDE and the WebRick server that comes with it. It's not the most stable platform, but hard work is being put into it, and it improves with every release. It's pretty nice to have real debugging around when you need it. I've found it a very useful tool and would recommend sticking with it.

For development I use MySQL and PostgreSQL on Windows XP. I tried to use SQLLite for a new project recently... but after a few frustrating problems, I just went back to MySQL.

I have not tried Netbeans.

Daniel Beardsley
+4  A: 

If you want to test out rails on windows, a simple way to start out is by installing InstantRails, it has everything you need to get started

AndreasKnudsen
A: 

It is that hard, it's really not worth trying to go the pure windows route for ruby. Poor ruby performance, awkward native gem compatibility at times etc. etc.

Definitely try out the VMWare + Linux route, most of your headaches will disappear. I have coworkers that successfully run this setup, sharing the source between windows and linux with netbeans as the IDE. It all seems to be pretty successful.

I started out with on just windows with InstantRails and the e text editor. It was ok, some frustration, but life got a lot easier after moving to virtualized linux.

Michael
+2  A: 

I use RadRails as my IDE with WAMP running the server stack. I love it. InstantRails would do the trick as well.

There are some other things coming down the line as well: David Heinemeier Hansson actually recommends using Phusion Passenger, which makes Rails deployment pretty darn simple. Worth checking out.

Jon Smock
+3  A: 

You're problems are not with Windows. I've been doing Rails on Windows for 2.5 yrs without any major problems. I find it easier than, say, Rails on Solaris.

I think Aptana RadRails is still a little confusing around the edges. You don't mention if you followed their install instructions or not. Step one is installing a ruby stack such as RubyStack or XAMPP. If you did that, you could run a MySQL DB instead of sqlite3.

I strongly disagree with your assessment of it not working because it didn't include sqlite3 in your download. Gems are the basic way in which you add stuff to your environment. Once you get the hang of installing the ones you need (gem install xxx) it's not such a big deal. It's so easy from the command line, the IDE is actually more complicated.

MattMcKnight
I can understand the need to install gems separately, but there's some additional trouble you have to go through on Windows w/ sqlite3-ruby. See http://domhackers.blogspot.com/2008/09/sqlite3-ruby-gem-on-windows.html
Don't forget to mention NetBeans as an IDE for Ruby on Rails, I've found it to be excellent and I've gone the Ruby1.8.6+XAMPP route. I've had no errors related to anything but my own code.
The Wicked Flea
+3  A: 

To be honest, if the only hurdles you had to jump were installing a gem (an essential piece of knowledge for Ruby with or without Rails) and downloading SQLite, then I'd suggest you've had a pretty pain-free experience! If you want some fun, try getting Oracle to work!

FWIW, I spend most of my working day fortunate enough to be working with Ruby and/on Rails. I work in a Windows desktop environment (but deploy to a strictly controlled Linux one, which can be entertaining) and to be honest, I'm pretty happy with the Scite editor supplied in the one-click Windows installer. I've spent some time configuring things like fonts, colours and abbreviations to improve productivity, and it mostly stays out of my way, which is nice.

If you take the time to learn how to work in the Ruby "style", a smart text editor is plenty. I only ever reach for one of the IDEs when I need a debugger, which, if you write test-driven code, is surprisingly rare. (I'm not anti-IDE, btw, I wouldn't consider touching a C# program without Visual Studio).

Mike Woodhouse
+3  A: 

I really Recommend starting with InstantRails. Its quick and lets you start coding in 2 minutes, which is the time to extract the archive.

Our company has 3 developers using RoR on Windows. We started out using InstantRails. Eventually we all replaced it with the Ruby One Click Installer and MySQL, so we could use the same database instead of hosting locally. After setting those up you need to install Rails, which can be done from the command prompt:

gem install rails

We just changed the database.yml file and all our exisiting code ran exactly the same as before.

We use two editors e for regular work and NetBeans for debugging. I find that the NetBeans auto-complete is painfully slow and marginally useful.

Development has been going very well, with no issues on windows. The only thing I listed that costs money is e, but the free Scite editor that comes with Ruby also works nicely.

Edit: Also, the Agile Web Development PDF is a vital tool. I love autocomplete in Visual studio, but having this book is the next best thing for rails. Especially the PDF because the index has clickable links that navigate you straight to what you are looking for. It also costs money, but is completely worth it.

Tilendor
By using the one click installer and gem install rails, you just recreated instantrails, basically.
DGM
Minus the sql server of course.
Tilendor
+1  A: 

As the person in another answer said, you've actually had a pretty painless experience.

I've done Windows-based RoR development for several years and have learned to live with the peculiarities. I use Eclipse with Aptana as a plugin, versus standalone Aptana because standalone Aptana has zero git support and the plugin has a little (see below). If you've never worked with Unix or Linux, then I'd say that learning to deal with Rails on Windows would be easier than learning Unix/Linux from the ground up.

That being said, I can think of two areas where it's becoming harder and harder to stay on Windows.

  1. Gems for which there are no native binaries available (yet) An upgrade to a gem you use for which no one has built native Windows binaries will be unavailable. One I've dealt with recently like this was hpricot. Issuing a "gem upgrade" will break on those gems, because it will pull down the source and try to build it. You will need to install Visual C++ version 6 or MinGW (along with a MinGW kit-built Ruby) to overcome this problem. Not a huge deal - I found a VC6 torrent, installed, configured, tweaked, and now have no problems. But it's a hassle that sucked up a day or two of my time.

  2. Git support Git on Windows sucks ass, there is no way around it. Everything in the Rails/Ruby world is going to Git, for good reason, so this is a big deal.

2 is what's prompting me to make the switch to Linux as my dev platform, within VirtualBox on my desktop and native on my laptop. But, I'm pretty familiar with Unix/Linux so this is not a big change for me to make. If you are comfortable in Linux, then yes you might want to think about switching.

Yardboy
A: 

I know this may sound radical, and it may not be an option for you. But it is less radical than you might think: What I did is bought a Mac! And it is phenomenal, because with VMWare Fusion or Parallels (I think Parallels is better in the most up-to-date versions), the Mac is an excellent machine for doing Windows development on.

I do Visual Studio development every day on a virtual machine on my Mac (as do many other people), with no problems whatsoever. In case you didn't know, Mac runs on Intel now, so at the hardware level the Mac is not significantly different than a Dell (except the hardware is much higher quality ... but I don't want to start preaching).

Mac's OS X is built on Unix. I do Ruby development all the time on it (TextMate is my editor of choice).

Really, I think the Mac is the best machine for running everything: Windows, Mac OS X and Unix.

Charlie Flowers
A: 

I think Aptana Studio is a good IDE for RoR. At startup it gives options for downloading and installing the required gems like sqlite etc. You can run ruby commands in the console window or run the mongrel server, debug, view browser output and do everything you want. I have been using Aptana Studio in Windows with mysql gem and its own mongrel server. Works fine.

Srividya Sharma