benhoskings/babushka — Issue #182: Installing rbenv as multiple users
Author: ileitch
Created: 2012-02-10 19:49:35+00:00
State: open

Hey, I need rbenv installed as root and a deploy user.

The dep is simple, based off your own:

```
dep 'rbenv-deploy', :user do
met? {
File.exists?("#{home_dir}/.rbenv/bin/rbenv")
}

def home_dir
user == 'root' ? '/root' : "/home/#{user}"
end

meet {
git 'https://github.com/sstephenson/rbenv.git', :to => "#{home_dir}/.rbenv"
shell("echo 'export PATH=\"$HOME/.rbenv/bin:$PATH\"' >> #{home_dir}/.bash_profile")
shell("echo 'eval \"$(rbenv init -)\"' >> #{home_dir}/.bash_profile")
}
end
```

I also use your rbenv meta dep and pass through the user.

```
requires '1.9.3-perf.rbenv'.with('root'), '1.9.3-perf.rbenv'.with('deploy')
```

The problem is that that the return value of the met? condition is cached and thus rbenv isn't installed for the deploy user.

Is there a way to force met? to no use the cache? Another approach is to duplicate the dep for both users...

Cheers