11 January 2007

Capistrano deploy + Subversion version

Sometimes the mirrors aren't in alignment. Last night was one of those nights for me, and when I can't get something to work (the way I want it to) I tend to dig in my heels and keep pushing. Sometimes that just makes things worse.

I'm working on my first time using Capistrano to deploy a rails app. I have my app in a Subversion repository on my Linux server but I'm working from my Mac Powerbook. I'm walking through the instructions in both the Agile Web Development with Rails book, and the Capistrano manual on the RoR website.

Straightforward enough, once I get my rake/cap commands correct. I get down to the "cap deploy" step and get this error:

$ cap deploy
* executing task deploy
* executing task update
** transaction: start
* executing task update_code
* querying latest revision...
svn: invalid option: --limit
Type 'svn help' for usage.
*** [update_code] transaction: rollback
* [update_code] rolling back

Ok, at this point I have no way to know what svn command the script was trying to execute because it's all behind-the-scenes magic. There's probably a way to find out but I'm too new at this to know. So, Google to the rescue - I find this:

svn log --limit is in 1.2.x, not 1.1.x, so you need to have a 1.2.x

My server has a higher version than 1.2.x, but the client on my laptop is running the 1.1.x client. No problem, I installed it using fink, I'll just update it. No matter what I tried, fink and apt-get told me that I had the most up-to-date version, even though the fink website tells me the stable package is 1.4 something. I tried to get fink to update it's own binary version - wouldn't do it. So, I follow the instructions on the fink site to update from source. Huge mistake. It took f o r e v e r. Fink is now up-to-date on my laptop, but it still wouldn't update svn-client. Whatever. Why did I waste my time like this? Write it off as a learning experience...

So, I used fink to remove svn-client, and downloaded the binary linked on the subversion website. Problem solved.

I guess in this fast-paced web-dev world I need to keep my packages all up-to-date. Sometimes.

10 January 2007

Capistrano show_deploy_tasks

Ok - Ruby on Rails is way cool. And now I'm trying out a deployment for the first time using Capistrano.

The problem I'm finding with all of this is that I'm chasing a moving target and the documentation can't even keep up. Here are a couple of examples:

The documentation told me that I could get a list of deployment tasks and their descriptions by typing "rake show_deploy_tasks". Wrong:

$ rake show_deploy_tasks
rake aborted!
Don't know how to build task 'show_deploy_tasks'

The new command is "cap show_tasks".

Also, the "rake remote:setup" command is deprecated. Use "cap setup" instead.

Really, it's pretty crazy. I'm using the latest Agile book and reading the Cap manual from the Rails site.