Tuesday, March 20, 2007

Web Programming, Hobo-style

Today I embark on a great journey.

I've been reading about Ruby on Rails since my buddy Jeremiah recommended it. I really wish that I had spent some time up front getting into the Ruby language and the Rails framework, because it would have saved a huge amount of time on some of the projects that I've been working on over the last year. I finally decided that it was time to really dig in and learn the ropes, and started by watching the Ruby on Rails screencasts. In a word: Wow! All the great stuff that I had heard about Rails was true. It was just what I was looking for: a standardized system designed to handle all of the repetitive, tedious tasks that go along with building web applications, like creating data objects with dozens of properties to match your database columns.

I installed Ruby on my Windows XP box with no trouble using the one-click installer. But when it came time to install Rails through the gems package manager, I got an error at the end about how it couldn't auto-generate some bit of documentation. Then when I tried starting up a test WEBrick server, it bombed out with an error.

It turns out that there is a bug with the current Ruby Gems package. The instructions that I found didn't quite work, but here's what did:

  1. gem env

  2. In the output from "gem env," find the GEM PATH directory, go there, and delete the "source_cache" file from that directory.

  3. gem update
    If it asks you what to do with any specific gem package, just skip it and finish.

  4. gem update --system
    Although this would seem to be the logical step after deleting the source_cache, I found that it produced this error:

    ERROR: While executing gem ... (Gem::GemNotFoundException)

    Could not find rubygems-update (> 0) in any repository

    But running "gem update" first, and then following with "gem update --system" fixed it.

  5. gem install rails --include-dependencies
    If you get an error that the rails gem is in an invalid format, try running "gem update rails" instead.


At this point, I got the message "Successfully installed rails-1.2.3" and I was good to go.
Booting WEBrick...

Rails application started on http://0.0.0.0:3000


Here's the rest of the Ruby on Windows installation process

0 Comments:

Post a Comment

<< Home