Help! I need a Capistrano guru!

This should be the easy bit!

I have Capistrano set up to deploy my app. I’m using a pack of
mongrels, so I’ve included the Ruby gem mongrel_cluster, including the
mongrel cluster recipes in my deploy.rb file.

From what I understand, I shoulc be able to define any task I like in
the deploy.rb file. I should then be able to run it with rake

I should also be able to create hook tasks - before_update_code and
after_update_code for example.

The behaviour I am getting is confusing.

Tasks I define don’t work - rake doesn’t ‘know how to build’ them.

Tasks I define ARE shown if I type ‘rake remote:show_tasks’

Tasks that are defined in the demo sections of the created deploy.rb
file show the same behaviour.

If I name a task something like ‘update_code’, it is visible in
show_tasks AND works.

If I try to call a task only defined in the mongrel recipes origibal
file by name, it doesn’t work.

The script works because it overrides things like ‘spinner’ and uses
them to call tasks like ‘start_mongrel_cluster’… So if I call a
defined task from inside a task, it might work.

My next steps will be:

1: Find the file deploy.rb is extending.
2: Find the ‘update_code’ task.
3: Copy it into my deploy.rb
4: Call ‘after_update_code’ explicitly from within it.

It shouldn’t be that hard! I also have a feeling SOMETHING will happen
to stop it working ;^). It’s been that kinda couple of days.

Does anyone know why this is happening? It happens if I deploy from my
Windoze box, or if I deploy from the linux server itself (from another
dir I checked out for testing with ‘on site’.)

Is it a new version problem? (I’m using the latest.) Is it a
configuration I haven’t done? Some instructions I’ve somehow missed?
The fact I created the deploy.rb file on Windows? Have I angered the

Please help. This is driving me absolutely nuts!

OK, the strange and awkward deployment script is working. The site is
deployed via SVN, the sym links I needed to make to my content are
being created, Apache is serving the pages. Yay.

I had to hunt for .rb files containing the tasks I wanted to hook into,
copy them to my deploy.rb file, and explicitly add in calls to the
‘after’ hooks I worte to make it play. That’s not the smart, easy
Capistrano deployment I was promised… I have to be doing something
wrong, but I’m out of options as to what.

I’m not sure the script is deploying the site as a production site
rather than a development site. Errors are shown on the web page itself
with corresponding SQL, which is strange. The mongrel logs tell me that
they’re starting the service using the production environment and the
production.yml file in config/environments states that all requests
should NOT be considered local.

Any ideas anyone? I’m still mightily confused. Things just ain’t
workin’ the way they’re advertised!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs