37signals/pow — Issue #247: Recursively search parent directories for .rvmrc
Author: tomjakubowski
Created: 2011-11-12 03:48:05+00:00
State: open

I have a situation now where the Rack app I'd like pow to host is not in that project's root directory, but rather a subdirectory. To this end, I symlinked the directory containing the config.ru (`~/Documents/Code/project/rackapp`) to ~/.pow/rackapp. Contrary to RVM's (v1.8.3) behavior shown below, Pow failed to load the .rvmrc in the project's root directory:

$ cd ~
$ rvm env gemdir
/Users/tom/.rvm/gems/ruby-1.9.2-p290
$ cd ~/Documents/Code/project/rackapp
$ rvm env gemdir
/Users/tom/.rvm/gems/ruby-1.9.2-p290@project
$ cat .rvmrc
cat: .rvmrc: No such file or directory
$ cat ../.rvmrc
... (project's rvmrc) ...

Indeed it appears that Pow only searches the symlinked directory itself, and not its parent directories, for a .rvmrc (lib/rack_application.js, loadRvmEnvironment function). This was a source of frustrating confusion for me. I fixed my problem by making a symlink to the project/.rvmrc in project/rackapp/, but it seems to me to make more sense to emulate RVM's behavior to avoid this kind of confusion. If not, hopefully this report will steer anyone else with my problem down the right path.