Wednesday, January 25, 2006

Diving into Ruby

Brian introduced me to Ruby fully a year ago, but I only started to code something in it last month. My initial reaction has been very, very positive. The only problem I have had with anything in the Ruby or Rails environments related to the known-broken SaltedHashLoginGenerator, which I eventually decided to avoid for now.

Tonight I attended the first (some say second) meeting of NovaRUG. I was hesitate about attending another users group, especially after Bernadette noted that it was "so ninties" to do so. However, I was not at all hesitate about hearing what Rich Kilmer was up to. Brian calls him the more productive person he knows, and with good reason. Rich is the genius behind Ruby Gems and kindly hosts RubyForge.

Rich presented two Ruby applications. The first was a prototype mid-air refueling simulation for the U.S. Air Force via BBN. He (amazingly( pulled it off in 200 hours of coding, complete with a multi-layer Mercador-projection map by making use of his ActiveStep GUI API for Macromedia Flash. It was a stunning peice of discliplined, logical thought. The second app was the upcoming product from his company InfoEther, called Indi. Indi is a portable, PDA-like environment on a USB drive. It includes two executables, one each for Windows and Mac OS X. Running either will bootstrap a browser/Flash environment to run the Ruby application. Very cool. A Linux version will come out as soon as Macromedia allows Linux to support Flash 8 format.

I'm not going to announce my own Ruby app yet, just in case my impending move to Fredericksburg and trip to Australia get in the way of completion. However, rest assured that I will blog it, release it under an Open Source license and throw up a service to allow free use as soon as I have it in a pretty state.


  1. How is saltedhashlogingenerator broken? I'm writing a Rails app and am curious, before I spend time trying to get it to work.

  2. After following the SaltedLoginGeneratorQuickstart, I had a series of errors. I was using Ruby 1.8.4, Rails 1.0.0 on Mac OS X 10.4.4. I cleaned up all the errors but this one:

      [./test/functional/user_controller_test.rb:43:in `do_test_signup'
      ./test/functional/user_controller_test.rb:151:in `test_signup']:
    Expected response to be a <:redirect>, but was <200>

    At this point, I could get a login page, but an attempt to create an account would fail when trying to send the confirmation email. I validated that I could programmatically and manually (with ESTMP and SMTP AUTH) send email using the settings I had chosen. I set the mail settings in config/environments/development.rb | test.rb | production.rb.

    The SaltedHashLoginGenerator page says that this error could be caused by failure to use an INNODB database type in MySQL, but I was. At least one other developer (Chanan Braunstein) reported on that page that he had this error in conjunction with using an INNODB database, but nobody replied to his question. That, coupled with the fact that the page was updated just days ago and I found a blog entry via Google with a similar report, left me feeling that the SaltedHashLoginGenerator was not yet ready for prime time.

    I traced the error to app/controllers/user_controller.rb in the line "UserNotify.deliver_signup(@user, @params['user']['password'], url)" and on from there to the ActiveMailer class itself. Since this works for other people and the SaltedHashLoginGenerator page says that they have just added "Rails 0.13.1 compatibility", I took it to be either a versioning or an environmental problem. I tried it with Ruby 1.8.2 and Rails 0.13.1, which resulted in the same error. I also tried it under Locomotive, instead of my built-from-source Ruby environment, to no avail. At that point, I rolled back to the simpler LoginGenerator :(

    I think it is close to working and will be awesom when it does. It just isn't widely tested enough yet. I may try it under Linux before I deploy my app into production.