# SwitchTower bugs: shared\_dir, before\_setup?

**URL:** <https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640>\
**Category:** Rails\
**Created:** [December 7, 2005, 5:29am UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640 "2005-12-07T05:29:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joseph.moore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@joseph.moore](https://www.ruby-forum.com/u/joseph.moore)\
**Post date:** [December 7, 2005, 5:29am UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640/1 "2005-12-07T05:29:44Z")

</div>

I installed SwitchTower yesterday and had a couple of problems. I’m  
not sure if they are known bugs, but if not, FYI; of course it’s  
possible that I missed something.

1 - SwitchTower did not create the “shared” directory by default as  
stated in the documentation. More importantly, the shared/log  
directory was not created automatically, which is problematic since  
SwitchTower created symbolic links to this directory.

Setting the shared\_dir variable explicitly in the deploy.rb file did  
not fix this. As a result the application would not start until we  
manually created the ourapp/shared/log directory.

2 - According to the documentation, we have many after\_ and before\_  
tasks. Thus we attempted to work around the non-creation of the  
shared\_dir by implementing after\_setup in config/deploy.rb.

No dice â?? it was never executed; maybe we needed to explicitly call it  
somehow, be we haven’t figured it out yet (please let me know if you  
know how). We ended up implementing after\_update\_code instead.

– Joe

---

<div class="post-metadata">

**Author:** ![joseph.moore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@joseph.moore](https://www.ruby-forum.com/u/joseph.moore)\
**Post date:** [December 7, 2005, 4:22pm UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640/2 "2005-12-07T16:22:19Z")

</div>

On Dec 6, 2005, at 9:27 PM, Joseph M. wrote:

> I installed SwitchTower yesterday and had a couple of problems. I’m  
> not sure if they are known bugs, but if not, FYI; of course it’s  
> possible that I missed something.

Did you explicitly run the ‘setup’ task? If so, were there any errors?

- Jamis

---

<div class="post-metadata">

**Author:** ![joseph.moore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@joseph.moore](https://www.ruby-forum.com/u/joseph.moore)\
**Post date:** [December 7, 2005, 10:13pm UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640/3 "2005-12-07T22:13:54Z")

</div>

Jamis –

We tried, but maybe we’re not running it correctly:

* * *

## $ cd blah/project $ rake setup (in /home/blah/project/) rake aborted! Don’t know how to build task ‘setup’

– Joe

---

<div class="post-metadata">

**Author:** ![joseph.moore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@joseph.moore](https://www.ruby-forum.com/u/joseph.moore)\
**Post date:** [December 7, 2005, 5:39pm UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640/4 "2005-12-07T17:39:49Z")

</div>

On 12/6/05, Joseph M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Setting the shared\_dir variable explicitly in the deploy.rb file did  
> not fix this. As a result the application would not start until we  
> manually created the ourapp/shared/log directory.

This might not be related, but it’s something to watch out for:  
shared\_dir is different than shared\_path. shared\_dir is the name of  
the shared directory (such as “shared”), while shared\_path is the full  
path for that directory (such as “/ourapp/shared”). I was bitten by  
that, but I’ve found SwitchTower to be good about reporting errors  
during tasks as Jamis mentioned.

---

<div class="post-metadata">

**Author:** ![joseph.moore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@joseph.moore](https://www.ruby-forum.com/u/joseph.moore)\
**Post date:** [December 7, 2005, 10:22pm UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640/5 "2005-12-07T22:22:26Z")

</div>

There is no default rake task for setup. You need to run:

switchtower -r config/deploy -a setup

Joshua Sierles

---

<div class="post-metadata">

**Author:** ![joseph.moore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@joseph.moore](https://www.ruby-forum.com/u/joseph.moore)\
**Post date:** [December 8, 2005, 12:46am UTC](https://www.ruby-forum.com/t/switchtower-bugs-shared-dir-before-setup/49640/6 "2005-12-08T00:46:25Z")

</div>

On Dec 7, 2005, at 2:10 PM, Joseph M. wrote:

> * * *

There’s no rake task for the setup. You can access it using the  
‘remote\_exec’ task:

rake remote\_exec ACTION=setup

Only a few of the ST tasks have corresponding rake tasks (deploy,  
rollback).

- Jamis
