Monday, June 29, 2009

I Really Hate Rails. A Lot.

Why? Because it's not worth it. Over the past couple weeks I've been working on a project that uses Ruby on Rails, trying to develop a plugin for it. It has been an absolute nightmare.




First I tried installing Rails on Windows. Ruby is a language that makes very heavy use of the command line and command line tools. As you may have guessed, Windows doesn't play well with that. Getting Ruby running is easy enough, but anything past that becomes tedious. Here was my experience.


I needed to work on a project that resides in a git repository, which is where the trouble started. Getting git to work on Windows took awhile, but I managed to get it up without too much trouble, so I continued on. I downloaded the Ruby One-Click Installer, ran it, and was happy to see everything was working fine -- or so I thought.


Next I had to install the Rails gem-- which should be easy enough, but no matter what I try, the gem command always says I need to update to a different version of RubyGems (even though it's the latest version). Eventually I managed to fix that somehow (no idea how). Second, the project I'm working on specifically requires Rails 2.2 -- not a big deal, just add -v=2.2 to the install command. Well, I lost some time here just because Windows wants the entire "-v=2.2", not just -v="2.2" string to be wrapped in quotes, or it will completely fail.


So I finally get the right versions of everything installed and I'm ready to get a running copy of this application. I try starting the server (ruby script/server) and get the message that I need to migrate the database. Easy enough -- just a simple rake db:migrate command right? Wrong. The rake failed because I needed to run rake create_a_secret. Fine. So I run rake create_a_secret, which fails because the command apparently makes use of some commands that don't exist on Windows machines. At this point I'm extremely frustrated.



Trying it on Mac:

So most Rails users use Macs, so I figured I'd try getting this all set up there. I retrace the steps I took on Windows and was surprised to find that it was relatively painless. I got the base application up and running, so I decided to create a new project so I could actually start learning Rails. Everything seems to be working fine, until I want to start creating relationships. Turns out sqlite produces all sorts of errors when using the belongs_to, has_many, etc functions. Well, I already had MySQL installed for the application I was working on so I figured I'd just change the configuration to use MySQL instead. Well that failed too. Turns out to make everything work I'd have to download the MySQL source code, the mysql gem source code, compile them against each other and do all sorts of other stuff just to make this application connect to MySQL. Not worth it.



By this point I've spent so much time trying to get Rails up and running that I'm ready to throw my laptop across the room. For all the work it takes to get a working rails environment, I just don't think it's worth it to choose it as platform for development. The reason I got into web development is because the technologies are cross-platform and applications can be delivered to any system. On top of that, you don't need much to create a web site, just a text editor and a server. Ruby has so many dependencies, requirements, and quirks that it causes more problems than it solves. The syntax is very implicit, making it difficult to follow for beginners.



These are some of the reasons I chose to start this project. I wanted a framework that didn't require a single bit of command-line interaction (no I don't have anything against the command line-- but it's a system tool, not a web development tool), that could be used from any machine, and that didn't NEED to be installed, just loaded (require_once('wax_init.php');).

No comments:

Post a Comment