# Capistrano/ext/multistage?

**URL:** <https://www.ruby-forum.com/t/capistrano-ext-multistage/144012>\
**Category:** Rails\
**Created:** [July 24, 2008, 5:06pm UTC](https://www.ruby-forum.com/t/capistrano-ext-multistage/144012 "2008-07-24T17:06:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![helix\_tp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/ed655f/32.png) [@helix\_tp](https://www.ruby-forum.com/u/helix_tp)\
**Post date:** [July 24, 2008, 5:06pm UTC](https://www.ruby-forum.com/t/capistrano-ext-multistage/144012/1 "2008-07-24T17:06:02Z")

</div>

This may really be an ec2onrails question, but figured I’d ask anyway…

After getting fairly convoluted logic in my deploy.rb to handle  
multiple environments, I discovered capistrano/ext/multistage, which  
looks like exacty what I need.

When I try to use it, though, I’m getting this error:

cap testing ec2onrails:setup

- executing `testing' triggering start callbacks for`ec2onrails:setup’
- executing `multistage:ensure’
- executing `ec2onrails:setup’
- executing `ec2onrails:server:set_admin_mail_forward_address'`ec2onrails:server:set\_admin\_mail\_forward\_address’ is only run for  
servers matching {:roles=\>[]}, but no servers matched

(pretty sure I have my deploy.rb changed correctly, and have rails\_env  
and role specifications in my config/deploy/testing.rb)

I did a little digging and it looks like what’s happening is that in  
recipes.rb, the setting of :all\_admin\_role\_names  
and :all\_non\_admin\_role\_names is happening /before/ multistage calls  
the .rb file, so none of the roles are defined at that point.

Seems weird, though, because it sounds like this is working for other  
people.

Thoughts?

Thanks,

dwh

---

<div class="post-metadata">

**Author:** ![helix\_tp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/ed655f/32.png) [@helix\_tp](https://www.ruby-forum.com/u/helix_tp)\
**Post date:** [July 25, 2008, 12:58pm UTC](https://www.ruby-forum.com/t/capistrano-ext-multistage/144012/2 "2008-07-25T12:58:14Z")

</div>

I’ve got the exact same problem ☹
