Weirdness with "nested" .ruby-version files #172

Open
jacknagel opened this Issue Jul 5, 2013 · 1 comment

2 participants

@jacknagel

Given the following:

$ cat ~/.ruby-version
ruby-2.0.0-p247
$ cat ~/foo/.ruby-version
ruby-2.0.0-p247
$ chruby
   jruby-1.7.4
   ruby-1.8.7-p374
   ruby-1.9.3-p448
 * ruby-2.0.0-p247
   ruby-2.1.0-dev

I see the following in a fresh shell starting from $HOME:

$ chruby 1.9
$ cd foo
$ chruby
   jruby-1.7.4
   ruby-1.8.7-p374
 * ruby-1.9.3-p448
   ruby-2.0.0-p247
   ruby-2.1.0-dev

I would expect chruby to respect the .ruby-version in the "foo" directory.

I can reproduce this on 0.3.6 and HEAD. However the behavior *does not* reproduce unless the contents of the .ruby-version files are identical.

@postmodern
Owner

Ah, this is because RUBY_AUTO_VERSION is still set to ruby-2.0.0-p247, so even though we've explicitly switched to another Ruby, chruby_auto thinks we're will using ruby-2.0.0-p247.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment