Monthly Archive for November, 2005

Ruby on Rails Evaluation, Part Deux

So, apparently, I need to take back my last paragraph, because I can’t actually get my first application up and running. I tried to build a tiny little sample app (following there directions), and I get an error message:

Application error
Rails application failed to start properly

Ah well. Kind of a bummer. But there’s a lot here that just doesn’t seem quite ready for prime-time (or ready for non-Apache admins like me). I don’t have much more time to spend on this, but this has given me a lot of background as to what Rails is trying to accomplish. Here are my critiques:

First off, there seems to be a lot of effort in tying the naming of your database objects helping to build the user interface. For example, if you name a table “People”, then there will automatically be methods of a class named “Person”. There’s apparently some kind of singular noun/plural noun lookup table. There are so many things in this approach to offend a database guy that I’m not sure where to start. This works great for very simple sign-up forms. It also works great if you plan on using your relational database like a series of spreadsheet. But this is simply kinda dumb, in my view. I’m sure there are ways to override this, but to encourage this type of database programming is irresponsible. On top of it all, it’s an accepted standard that you don’t name your database tables as plural, but in the singular form instead. A table built to hold information about people should be called “Person” or “Individual”, not “People”.

So, my first instinct is to wait 6 months until the installion and setup is a bit more my speed (I can’t afford to spend half a day setting up my development environment) and give it another crack. In the meantime, I’ll try and evaluate some competing products for this site.

Evaluation: Ruby on Rails

Evaluation: Ruby on Rails Development Platform. Recently, I’ve been reading a lot about Ruby on Rails as THE new development platform. I decided to learn a bit about it. Whenever I look into this type of thing, my first challenge is to simply get a development bed up and running where I can write a program. I’ll detail my steps in this post and give you an idea of how easy it was to get things up and running and whether I think it can live up to the hype. Step 1: Introducing myself to Ruby on Rails. First stop, Google. Search for “Ruby on Rails” and you get this page. The first result is what seems to be the “official” Ruby on Rails webpage. Good start. I decided to do a little reading. The top-line description is:

Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups

Getting Started: So, my first question is “What is Ruby?”. I do some digging there too and learn that:

“Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, and portable.”

So, Ruby is a new scripting language and Rails is a web framework which utilizes Ruby. My first instinct is to compare it to the relationship between Perl and PHP (though if this comparison will hold up remains to be seen). Apparently, Ruby is partially influenced by Eiffel and Ada with some Java and Python thrown in. My experience with all of these languages is minimal (I learned Ada for a week in college and have some some very minor programming in Java) so I’m a bit wary of the learning curve. (Here’s a nice, friendly Ruby tutorial).

Ok, back to the full-fledged “Ruby on Rails”. On the home page there are some nicely produced movies and tutorials on getting started. I go through the following: 1) 15m into video 2) I browse the Ruby Blog to get a quick feel for the personality and the players of the project. Also, I learn that they’re very close to releasing the official 1.0 version of the product. Good to know… 3) The Ruby Wiki also is a good for a quick glance before installation. Especially this page, which give total Ruby on Rails (RoR) newbs like me some background on the project and what it is trying to accomplish.
Step 2:Installation:
So, I’m bored with reading by now…it’s time for an actual installation. My personal workstation runs Windows XP SP2, but all my hosted apps are on a FreeBSD platform. I’ll try and install it locally on my Windows box and maybe later, if I’ve got time I’ll put it on my FreeBSD servers. We’ll see.

So, I start off using this page to help me with my Windows Rails installation. I downloaded the latest Ruby Windows installer (available here). That took a few minutes to install. Then, I have to update my Ruby installation using something called “RubyGems” by typing “gem update” at the command prompt. That took a while (>15 minutes). At the end of all this, I’ve got Ruby installed, but not yet the full “Ruby on Rails” framework. Now I need to install Rails by typing “gem install rails –include-dependencies” at the command prompt. This install Rails (which utilizes the previously installed Ruby). Another 10 minutes or so. Then I needed to type “rails {path to rails}”, which creates a skeleton directory for a brand new Ruby on Rails application. Now, I’ve got configure my Apache web server to work correctly with RoR. To do this I first need to download FastCGI (available here) and include a LoadModule command in my Apache httpd file (e.g. “LoadModule fastcgi_module “/mod_fastcgi-2.4.2-AP20.dll”. Then came a whole mess of configuration settings changes in various files which is best described here, starting at the heading which reads “Creating and Configuring a Ruby On Rails Application”. That seemed to do the trick.

This was all kind of a pain in the ass, but only took about 2-3 hours to complete fully (including reading and background learning). So, if you’re relatively familiar with Apache and web technologies in general, you shouldn’t have too many problems. There were a lot of steps involved, but they all seemed to work as advertised. As long as you follow the documentation, you shouldn’t have too many problems. More to come….

Content Management is fun…

This post is not just a test of the new “Post to your blog by email”, but also a post about content management and easy webpage updating in general. A meta-post if you will..

I can’t tell you how many times I’ve been asked to take over a web site, either for a political candidate or a business, and they tell me the same story: “We paid a bunch of money for a website to a design company and now any time I want a change to it I have to shell out a few hundred bucks and it takes days to finish too,” they cry as we peruse their live site which has old pictures of the CEO back when he had hair, or stale headlines from 6 months back. They ask me to change the site around so that they can make updates themselves.

Obviously, for people who know web development, to deliver this kind of product is irresponsible bordering on the criminal. Usually it happens when a design firm will (rightfully) charge a ton of money for a logo and site design. But then, because the client doesn’t know any better, the design firm will then use their fancy-shmancy development suite (like Dreamweaver
or GoLive) to automatically generate the web page from their design, then charge a few thousand dollars for web development on top of the thousands they’ve already spent for site design. I’ve seen the invoices. This actually happens. The problem with this is that these products the designers use build ridiculous code which doesn’t even come close to adhering to today’s web development standards (for more about Web Standards, visit The Web Standards Project)

To fix these problems usually involves a relatively large codebase re-write and integration with one of the zillions of content management solutions out there. Usually I find the WordPress does the trick quickly and simply, but there are many, many more to choose from. I’ll write more in the coming weeks about building web pages which anyone can update.

Wordpress Integration

I just did an overhaul of a site for a relatively large business. It’s a very nicely designed site. However, the site was built originally using GoLive, which means that, in it’s original state, it was a severe headache to update the site without using GoLive. Let me be clear: to deliver a final product that has been automatically generated from a design suite, and then charge for it should be illegal. This company had a map of the United States, and each state was clickable and could display two types of data related to the state. So, GoLive generated 100 static HTML pages to display each of the states’ data. Unbelievable. I was tasked to fix this issue. I used WordPress and combined it with a plug-in called Custom Field Gui which will add custom fields to every post. Now, there’s one page, one place to make layout and template changes, and the client can now update the site themselves. And it took just about 6 hours to accomplish. So, if you ever hire someone to build your business or campaign a professional website, make sure you get a product that adheres to some semblance of professional development standards.