Ruby on Rails with Windows – How I made it work

I have been developing with Ruby on Rails over the last few weeks. Coming from the ASP .NET/C#/VB world, I am a total stranger to a programming language like Ruby. Any new programming language is fun to learn! Ruby was even more exciting cause it was a new kinda language to me. Though I think Ruby is not as user-friendly as C# or Java, it is as powerful and flexible if not better. Combined with Rails, Ruby becomes a platform that facilitates quick and efficient development of database-driven web applications.

Ruby has been known work to well with Mac OS, Linux and Cygwin traditionally. I came to understand that it doesnt work very well with Windows. There are a number of pitfalls that are associated with Ruby or Rails running on Windows. Here, I going to talk about a couple that I hit when I was trying to get RoR to work on Windows :

  • Most of the unit tests in my RoR project were failing throwing some weird database errors. I had done everything right from installing Ruby to installing the various gems needed for the project. After a quite a bit of googling, we learnt we could resolved these issues by making a simple change to the MySQL settings. The "Enable Strict mode" option had to be disabled using the MySQL interface config wizard. I ran the tests after this was done and voila!
  • This problem was even more perplexing than the above one. A bunch of unit tests were still failing with a dreadful "Segmentation fault" error (I m sure "ROR on Windows" folks might have seen this before). Some research on this error led to the finding that MySQL versions greater than 5.0.18 might cause this problem. So I downgraded my version of MySQL to 5.0.18 to see if that fixed my problem. No luck as yet! This was followed by trying out a number of other potential fixes like using different versions of libmysql.dll (the MySQL library used in Ruby), making changes to database configuration in the project etc. None of these helped me. After a few days of frustration, I uninstalled the MySQL gem and reinstalled it upon the advice of my colleague. That finally did the trick!

I m still puzzled how these fixes worked but glad they did :) .

Related posts:

  1. Rails Development on Windows: Native or Virtualize
  2. A Java Programmer’s transition to Ruby on Rails
  3. Testing various roles in ruby on rails
  4. What makes Ruby/Rails Development Fun
  5. Ruby on Rails Internship

Topics: , , ,

Comments: 2 so far

  1. I know this is completely unrelated to the post but I wasn’t sure where to ask the question. What is the status of RSH and can I get hold of the latest code and maybe assist in beta testing/writing fixes for it?

    Comment by Jamie Hill, Saturday, August 9, 2008 @ 1:18 pm

  2. Not sure what you are talking about here?

    Comment by Karthik Muthupalaniappan, Monday, August 11, 2008 @ 11:48 am

Leave a comment

Powered by WP Hashcash

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com