wayneeseguin/rvm — Issue #744: rvm fails to set $rvm_hooks_path for *_install hooks
Author: ssnodgra
Created: 2012-02-07 21:05:45+00:00
State: open

This is rvm 1.10.2 on RHEL6.

I'm trying to create an after_install hook that sets some selinux file contexts after installing a ruby with rvm. Unfortunately, rvm does not run my hook at all. After some troubleshooting, I found that the $rvm_hooks_path variable is not set at all when rvm looks for the before/after_install hooks, so it doesn't find them. Here's an example of this with some debug code I have in scripts/hook:

# cd /var/tmp
Hooks path is: /usr/local/rvm/hooks
Hook search list is: /var/tmp/.rvm/hooks/after_cd /usr/local/rvm/hooks/after_cd

When doing a cd, the hooks path is fine. Now do an install:

# rvm install 1.9.3
Hooks path is:
Hook search list is: /root/.rvm/hooks/before_install /before_install
...lots of install output...
Install of ruby-1.9.3-p0 - #complete
Hooks path is:
Hook search list is: /root/.rvm/hooks/after_install /after_install

So, instead of looking for the hooks in /usr/local/rvm/hooks like it is supposed to, it looks in / instead which fails. I'm trying to trace how $rvm_hooks_path gets set through the maze of scripts, but it's not so easy when you're not familiar with the code. Any ideas? Thanks.