This is a quick rig to demonstrate my problem using rbenv exec.
Run:
cd parent
ruby test.rb
- The parent should run on Ruby 1.9.2-p290
- It should then fork a child that runs on system ruby
- It then tries again setting RBENV_VERSION=system too.
Expected: Parent and child should run on different versions of Ruby.
Actual: The version of Ruby never changes.
I think the .rbenv-version files are set up correctly because:
$ cd parent
$ rbenv local
1.9.2-p290
$ cd ../child
$ rbenv local
system
$ rbenv shell
rbenv: no shell-specific version configured
Output on my system
$ cd parent
$ ruby test.rb
in parent, .rbenv-version file specifies 1.9.2-p290
version=1.9.2: /home/bronson/.rbenv/versions/1.9.2-p290/bin/ruby
executing child...
in child, .rbenv-version file specifies system
version=1.9.2: /home/bronson/.rbenv/versions/1.9.2-p290/bin/ruby
cwd is /tmp/1275927/child
back in parent, .rbenv-version file specifies 1.9.2-p290
version=1.9.2: /home/bronson/.rbenv/versions/1.9.2-p290/bin/ruby
executing child using RBENV_VERSION=system too...
in child, .rbenv-version file specifies system
version=1.9.2: /home/bronson/.rbenv/versions/1.9.2-p290/bin/ruby
cwd is /tmp/1275927/child