RSpec seems to make such intuitive sense, and now that I've started to wrap my head around TDD, I am starting to see the benefit.  Sure, initial development may be slower, but the overall development approach should help over the long-term maintenance of your code.

But then, RSpec completely stumped me. 

Thanks to the folks at StackOverflow, because this post, explains my problem exactly.  After multiple tries, my test just wouldn't work.  But with this explanation, I started wondering how the "click_link ...." test was working.  Then it hit me:  each "click_link" represents a user click, so the following test is now looking at the new page (just "clicked") and not the path I had specified above.  AHA!

Very interesting (and, sadly, unintuitive for the newbie).
 
 
Small victory dance.  (My Heroku solution was here.)

Knowing how much more there is to come, I'm a little overwhelmed.

By the way, big kudos to the people who provide answers at StackOverflow.  For all the scouring of the web that I've been doing, the best answers keep coming from there.   Thanks to you all!

Now, back at the tutorial!
 
 
I've read all over the web that "deploying to Heroku is totally painless!"  Wow.  2 days later, and my best answer was to start over, line by line.

Now, granted, I'm a complete newbie to Rails, so I'm sure to make every mistake possible.  But, wow, Heroku has been a complete pain in the ass!

First, I'm discovering that Heroku doesn't believe in error messages.  They simply state:
  • "We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly."
Now, maybe I'm supposed to "tail" the log files to find out what's happening.  But more specific error messages might be nice!!!!!  Oh, and the whole "we'll take a look at it" is completely bogus.  In my 3 days, I've seen this fail screen so many times, and I've never even had a popup in my "My Apps" page to say, "Hey, see there's a problem."  (At this point, I'd even take a trained professional's advice, if they were offering $50/hr to give me some tips.  They already have my credit card number...)

Second, Git is a newbie nightmare!  Seriously!  All I wanted to do was back up 5 commits!  How hard should that be?  I wanted everything I had done in those 5 commits to be UNDONE.  Isn't that the point of a versioning system?  Yeah, well, if there's a way to do this, then please let me know.  After searching all over the web and trying a number of "solutions", I ended up starting the tutorial over from scratch.  (Write one line of code, git commit, git push, git push heroku, test/verify.)  All the TDD that RSpec uses is great, and all the local testing passed with flying colours!  Then, upload to Heroku and watch it fail! 

So, now I'm trying to figure out what exactly is the cause.  I'm completely baffled, but so pissed off that I won't give it up.  Maybe I'll post more here as I go.

For those of you who are curious, here are my Heroku failures to-date (all of which yielded the exact same error screen described above):
  1. If you use an undeclared variable. 
    e.g. <%= link_to "Home" home_path %>  # Better specify home_path!!!
  2. Use coffee-rails.
    I'm still trouble-shooting this one, so I'll have to post more later.
  3. No, coffee-rails, which I think serves my JavaScript, isn't the problem.  The problem is that my "assets" aren't "precompiled".  Yeah.  In the olden days, compilers were for C, and so I guess I have much to learn.
  4. Am currently going through my "heroku log" files, after reading about them here.  I chose to use the following to get the last 200 lines into a local log file:
  • heroku logs -n 200 > log/heroku.log

    This is where I discovered the "precompiled assets" issue.  How to solve this one?  I will wait and look for that tomorrow... or maybe Monday...

    Note: Yes, it took until Monday, and I finally found my solution!  Why this wasn't more obvious, I'll never know.  See Jeppe Liisberg's solution.
And, in searching for this answer, I discovered the instructions that I should have started with (Rails3 on Heroku/Cedar and Rails3.1 on Heroku/Cedar).  I can't remember why I decided to invoke "--stack cedar" but somebody somewhere in the Internet suggested it because it was "better".  Should I spend the time to figure out why "cedar" is better than "bamboo"?  Nah.  I think I'll just go with it.  (A little overwhelmed with all the decisions right now.) 

One final thing:  I spent hours trying to figure out how to setup the database config for the production (i.e. Heroku) site.  Then I found the link describing how to get this.  But there's not need to post it here, because then I found out that Heroku re-writes your production database config on upload (i.e. git push heroku).  So, there's no need to worry about this after all.  [...sigh...]
 
 
(Looking for errors and hiccups in learning Rails?  Try here.)

Often, the tips that are said to be important are hidden deep within a tutorial.  So, to act as an external data bank, I'm going to comment on some of these here. 

  1. Security Hole Warning - Make sure that you use "attr_accessible" to keep hackers out of your database.
    ...warning...
 
 
So, as I've posted in my bio, I've been learning Rails lately.  (Full name: Ruby on Rails)

I've been using Michael Hartl's RailsTutorial.org/book and it's been fantastic.  I've thought long and hard about paying the $85 for his screen-capture-videos, but with being unemployed, I've decided to go the free route.

The tutorial is amazingly detailed and the explanations are fantastic.  Michael does a great job of bringing the new-to-Rails programmer.                 ...
 
 
I know that people die everyday, but the topic of death seems to have come up a lot lately.  Maybe it's just the media, or maybe it's just me.  Maybe it's the public outpouring.  
  • Jack Layton - Canadian politician - Leader of the Official Opposition, Leader of the New Democratic Party.  Used "hash tag fail" in the televised leaders debate before the last election.  Received an official state funeral.  
  • Steve Jobs - Apple co-founder and CEO.  Amazing marketer and driven visionary.  Relentless (and possibly dangerous) in demanding excellence with simplicity. 
  • Al Davis - Owner of the NFL's Oakland Raiders.  A driven and involved owner who had a huge role in his team and never had a "hands off" management style.  
 
 
Picture
So, true to form, the @FredCybersocial was a great time. (The pint of Keith's Red on tap was excellent as usual, though next time, Daniel recommended I try a Picaroons flavour.  Thanks, James Joyce Pub!)

What I learned at today's Cybersocial:
  • those you expect/hope to meet won't be there;
  • those you meet won't be who you expected (surprising, eh?)
  • if you have a conversation, it will often be exactly what you needed!

 
 
Picture
I've just posted my links to I.T. employment in Fredericton.   I've included a number of general links, and a tip or two where necessary.  

Many companies are looking for someone with 3-5 years experience in very specific software, but KEEP THE FAITH!  Someone out there wants you, they just don't know it yet!  :-)

I'll copy the links here, to make them easier to find, and also to have a good laugh years from now when all the links are broken!

 
 
Picture
After an 8-year hiatus, I'm back in the information technology sector!  Yea!

Now, don't get me wrong.  Teaching was a blast!  But, with my recent move to New Brunswick, there's been lots of learning to do and great people to meet.

The first thing I learned is that there are a lot of really great people who are responsible for public school teaching.  Not only were the teachers great, but I also met some fine principals and vice-principals.  They were hard workers themselves, but always took time to be encouraging to me. While there seem to be many who slam the people (teachers, principals) in our current educational system, you won't find me doing that.