Getting started with Ruby On Rails on Windows

10 months ago

If you have a Windows machine and would like to dabble a bit with rails development the state of affairs is not that grim.

As it stands in early 2008 there are a large number of IDEs and tools you can use, getting Rails up and running is not hugely complicated.

Note, there is a one-click installer coming up for Rails on windows. My advice is to avoid it, not because it does not or will not work, but because installing stuff manually gives you better control, and teaches you more along the way.

Get up and running

  • Install Ruby : Go for version 1.8.X, 1.9 was recently released but it is still a while before people recommend using it for rails development.
  • Update your Gems – Ruby contains a packaging system which could be likened to a network connected version of windows installer. It manages installation and upgrades of “gems” which are re-usable components. Rails itself is just a collection of gems. Early in the release cycle of Rails 2.0 there was an issue with the Gem system that caused lots of woes installing Rails. To avoid any issues in future just run the following command (from the command line). It will update the gem gem :)
 
gem update --system
  • Install Rails – note: gems may depend on other gems, using the include dependencies command allows rails to update all of the dependent gems.
gem install rails --include-dependencies

That’s it Rails is installed, you can now create your first hello world app.

  • If you would like a more “unix-like” development environment – try cygwin it can co-exists side by side with a windows native ruby installation. I use cygwin to run rails plugins that do not run in windows native eg. Backgroundrb

Get yourself educated

  • Railscasts : This is a fantastic podcast. It cover a very large number of Rails topics. Ryan knows his stuff and his podcasts have the perfect pace.
  • The Rails Forum : If you get stuck, someone here will be happy to answer your questions.
  • The Rails Wiki : Another excellent resource about everything and anything involving rails.

Get yourself tooled up

  • Console : In Rails you will spend a fair amount of time on the console, this is a fantastic cmd replacement, it supports a tabbed interface, and you don’t have to jump through hoops to resize the window.
  • Firebug : probably the best javascript debugger out there, its very handy when debugging rails apps
  • YSlow : A very useful plugin for firefox (which requires firebug). It will help you optimize your web apps.

Choose an IDE

  • Aptana (free): My current IDE of choice, its based of Eclipse . It has a ton of features, and is fairly fast to load up. My current biggest gripe is that cut-and-paste seems a little slow, it is highly customizable and support everything from debugging to refactoring. I love the CSS support in Aptana.
  • NetBeans (Free) : A very capable IDE which, like Aptana, is written in Java. I found its load time a bit slow, and I seem to like the look and feel of Aptana a bit better. It support pretty much all the feature that Aptana does, and has a superior intellisense implementation.
  • JEdit (Free) : (With the ruby plugin) Used it for a while and found it rough around the edges. Support intellisense, Rails and most of the features the Java based IDEs.
  • Vim (Free) – With the Rails plugin”:http://wiki.rubyonrails.org/rails/pages/HowtoUseVimWithRails . I have no idea about this one, but if you are a vi user this may be worth a look.
  • FreeRIDE (Free) – It’s written in Ruby and has little to no special Rails support, a very basic fast multi-platform IDE.
  • SciTE (Free) – Ships with the Windows Ruby installer. More information about customizing it here . I use it to edit single ruby files, but it does not have the same amount of features the other Java based IDEs have. It is lightning fast though.
  • InType (free while in alpha): This IDE is still in alpha (it does not even have a file browser at the moment), it looks very promising and very similar to TextMate which is the IDE the Ruby on Rails team use.
  • E-TextEditor ($34.95): This is a TextMate clone for windows, it works best if you have Cygwin installed.
  • Arachno Ruby IDE ($49) – I have not used this, it does not support rails natively.
  • Ruby in Steel ($49 – $199) – A plugin for Visual Studio (that now also ships stand alone). It supports a very large amount of features, including intellisense and debugging. I have it installed at the moment, but tend to use Aptana.

Hope this helps someone out there, let me know if I missed anything or should expand

Comments

Zac

10 months ago

Hi Sam, Congrats on the new blog and thanks for the this post – very comprehensive.

You might want to check the linked headers of the posts though…

I read the posts through my google reader and when I click on one of your posts headers to open it in a new tab – the location is local “http://localhost:3000/posts.rss” for this post & “http://localhost:3000/posts/4” for the “nice GUI profiler for SqlLite (Profiler released to the public” post”…

Cheers.

Sam

10 months ago

Thanks Zac,

I think the RSS and Atom feeds are sorted now.

That will learn me to write my own blog engine :)

zac

10 months ago

works perfectly now :)

Niels

8 months ago

Heya Sam!

I ran into your blog because of the keywords BackgroundRB and Windows in one sentence ;-) So I am wondering which version of BackgroundRB did you manage to work on Windows? ‘Unfortunately’ I am currently working on a Rails app which requires Windows and I was thinking about using BackgroundRB for some stuff, until I read that it wasn’t working. So, I hope to hear it!

Thanks in advance,

- Niels

Sam

8 months ago

Hi Niels,

I managed to get the 1.0.1 or 1.0.2 background rb running under cygwin, I think it required some compilation and some libraries, but from what I recall it was pretty easy. (unlike beanstalkd which I could not get working under cygwin)

So, I guess the first step would be to install cygwin with all the dependencies backround rb will need, then install ruby under cygwin and then install the backgroundrb plugin. Watch out, from what I recall there is a very old version of backgroundrb lurking around, which you want to avoid.

I have not tested running rails under windows native and backroundrb under cygwin, but I do believe it should work, since the forking is done in the service and the comms is multiplatform.

I didn’t test on 1.0.3 which looks like the most recent, but I do believe it should work. I can not try it out at the moment cause I moved my dev box to linux. It seems backgroundrb is getting quite a bit of dev time at the moment.

Cheers Sam