Tagged: Ruby on Rails

June 8th, 2011

Chuck Noris on Rails

This evening I got together with a couple of people from work to get some more than trivial experience with Ruby on Rails with them, and try not to come across like a Perl zealot, Ruby weenie, or PyHole – those types of people whose single minded narrow minded zeal and certitude pretty much turn me off any technology regardless of its virtues.

Someone suggested that we change the venue of our Rails experience from an office at work to a patio at a watering hole. As Dave and I had planned to sample some Chuck Noris IPA after the session, we did the agile thing and headed out laptop at the ready. The three of us made it to Stout on Carlton street in spite of the tropical heat and humidity, the delays on the TTC, and much to my relief there were still growlers of Chuck Noris to be had. Once we arrived we made another quick decision to remain in the air conditioned lounge rather than swelter on the patio.

If there’s one thing I have learned from Walker Texas Ranger it is that no matter how desperate the situation it can all be resolved in the ten minutes before everyone has to go, so once I was hooked up to the WiFi and the first pint of IPA and some food had been consumed I was able to try a half hour of “trio programming” (agile + 50%!) getting a couple of screens going.

Some of the things we learned:

  • rvm is great.
  • bundler makes it really easy to switch rails versions, particularly when it’s easier to suspect the new 3.0.8 rather than anyhting we did!
  • Overconfidence is dangerous – we made several models, one of which was called Action. Not a good idea in rails. http://oldwiki.rubyonrails.org/rails/pages/ReservedWords
  • rails gives you a lot of functionality for a small investment in code.
  • Three heads are better than one.
  • We should try a place called Granite up near Yonge and Eglinton

This week is turning out pretty Ruby heavy, yesterday’s Toronto Ruby Brigade meetup, Chuck on Rails tonight, and a Ruby hacking meetup tomorrow…

September 11th, 2010

Exploring

I have been doing some exploring recently, and it has been quite invigorating.

In the real world I took a trip with my mother to Virden, Manitoba to find where my grandmother was born and baptized. It’s good to get out of the greater Toronto area and see some more rural Canada. It took many miles of travel on unpaved roads to reach the place my grandmother was born; the drive challenged and muddied the rental car. All in all a delightful Labour Day weekend out of town, albeit a little tiring.

In the software world I’m playing with Heroku as a place to see if the Rails application I’m writing really works. It’s amazing how much of an ecosystem has build up around Rails – not just Heroku and the tools it provides, but also things like Tim Pope‘s amazing collection of vim add-ons. One day web applications will seem natural to me, I’m sure. For now I have a few ideas from the long weekend I want to put into place, and a stack of personal email I have to sift through.

These have invigorated me because they have popped me out of my usual rut and given me a new perspective on a couple of things.

July 24th, 2010

cider, rvm, and homebrew

The rails installed by cider is a rails 3 beta. As I want to play with some of the examples for rails 2 I thought I should get the most recent ruby 1.8.7 and try to use rvm’s gem sets to get myself a rails 2 world set up

brew install `brew outdated`
rvm install ruby-1.8.7-p299
rvm --default ruby-1.8.7-p299

Was my first step to this, but when I tried irb this is what I saw:

ratdog:~ mike$ irb
no such file to load -- map_by_method
ruby-1.8.7-p299 > q

The cause of this was my ~/.irbrc which had been set up, and which has a whole bundle of useful gems added into it. Most of these are worth a post by themselves, but the suspects were:

  • map_by_method
  • what_methods
  • awesome_print
  • net-http-spy
  • hirb
  • looksee
  • wirble
  • sketches

I set up an rvm gemset and started installing gems:

rvm gemset create rails238
rvm ruby-1.8.7-p299@rails238
gem install map_by_method what_methods awesome_print net-http-spy hirb looksee wirble sketches
gem install rails -v 2.3.8
rvm --default ruby-1.8.7-p299@rails238

All appeared to go well, until I tried navigating to a demo appliction and look at the environment on the default splash screen, which complained about a missing sqlite3 gem. The sqlite3 gem wanted at least ruby-1.9.1 installed, so it was time to install another Ruby.

The ruby-1.9.1-p429 had a problem with gems, but a quick trip to Yahoo! revealed this message, so it was time to install another ruby!

rvm install ruby-1.9.1-p378
rvm use ruby-1.9.1-p378 --default
rvm gemset create rails238
rvm use ruby-1.9.1-p378@rails238 --default
gem install map_by_method what_methods awesome_print net-http-spy hirb looksee wirble sketches
gem install rails -v 2.3.8
gem install sqlite3

Now I can get to work playing with rails! The great thing is that I haven’t compromised my system Ruby, thanks to cider, rvm, and homebrew.

October 25th, 2009

The Week in Review

“Don’t believe what you read” seems to be this week’s theme.

On Monday I went to my first Rails Pub Nite for a few months, and there were a good forty or fifty people there. Most of them seemed to be doing some fun and interesting stuff with Rails, and there seemed to be lots of activity. Sometimes when I’m looking around various technology sites or blogs it would seem that the bloom is off the Rails rose, bit the Toronto Rails Pub Nites would offer a different perspective.

On Tuesday it was off to Roy Thomson Hall to hear the Cleveland Orchestra. I was pleasantly surprised that my listening to King Crimson for many years had prepared me to enjoy Shostakovich’s Symphony No. 5. The thing not to believe here is the Toronto Star’s review which seemed to focus on the reviewer’s expectations and not so much on what the Orchestra did.

Nest week it’s the Toronto Perl Mongers, and we’ll see what’s shaking in the local Perl world. There are so many opinions of Perl’s state out there that most of them can’t be true!

March 4th, 2009

Finding the Fun Again

Another few evenings playing with Rails (and paralleling the depot application from Agile Web Development with Rails (v3)) and I’m rediscovering the fun to be had with programming!

I have picked a project which is similar to something I’m doing at work to see what new perspectives using a different language and toolkit give me.

The biggest thing I noticed was that PostgreSQL and pgadmin3 is a delight to use.

February 25th, 2009

Rails Progress (slow but sure)

Each day when I have an hour or so to spare I am picking another aspect of my “toy” Rails application to work on. My strategy is to set small achievable goals, in the understanding that I will need to do some research and make some mistakes.

Many problems I come across seem to be due to poor scaling – a developer with a database with a few tens of rows sometimes never gets a taste of a the system with millions of rows under heavy load until users are out for blood.

Thanks to Jason Frankovitz I started looking at Railscasts, and this turned me on to the will_paginate plugin for pagination.

So now I have a migration which cooks up 10,000 user rows, and then I notice the difference in the naive “list all the users” and the paginated “list all the users, a page at a time”

One feature done today… now for the household chores: cat litter changing and putting out the garbage and recycling.

February 21st, 2009

Keeping going with Rails

My experiments with Rails are moving along slowly, and I’m happy with that. One of the things I have learned that I sometimes sabotage myself by expecting to do too much too quickly and then becoming despondent when things don’t move as quickly as I had expected. If I step back then I see how many things I’m doing:

  • Learning about VirtualBox.
  • Learning how to use Git.
  • Trying to learn Rails 2.2 using Rails 1.2 tutorials (D’oh!)
  • Setting up vim to be a productive “IDE” for Rails.
  • Taking another look at what PostgreSQL has to offer.

With Git and Rails I’m not just trying to use the tools well, I’m also internalising their way of looking at the world. That comes in its own good time. As for using vim (or vi) effectively, I have limped along with my limited repertoire for more than 20 years, so I should not have unrealistic expectations there!