sstephenson/rbenv — pull request #644 by spajus (2014-10-24 05:38:21+00:00)
Title: Don't attempt to cd to path without permissions

Following scenario illustrates a situation when /bin/rbenv fails to init due to directory permissions:

```

[tvaraneckas@sandbox ~]$ sudo -u mongrel bash
/opt/rbenv/bin/rbenv: line 46: cd: /home/tvaraneckas: Permission denied
rbenv: no such command `init'
[mongrel@sandbox tvaraneckas]$ source /etc/profile
/opt/rbenv/bin/rbenv: line 46: cd: /home/tvaraneckas: Permission denied
rbenv: no such command `init'
```

The fix simply does not try to cd to forbidden path, and initialization succeeds.