sstephenson/rbenv — Issue #136: How to load rbenv in ssh environment
Author: Sen
Created: 2011-10-30 11:00:58+00:00
State: open

In my senario, i use ssh command to invoke ruby's script. like this:
```bash
command="ruby_script ",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa ... ...
```

as rbenv required, need change
```ruby
!#/usr/bin/env ruby
```
to this:
```ruby
!#/usr/bin/env ruby-local-exec
```
then go to the ruby_script directory, set "rbenv local ***"
right?

now here is the problem,

ruby-local-exec can't be found, so i enable ssh environment, then put ruby-local-exec's path in ~/.ssh/environment
```bash
PATH=/home/user/.rbenv/bin:/usr/local/sbin...
```

now ruby-local-exec can found, but still not working:
```bash
/home/git/.rbenv/bin/ruby-local-exec: line 16: exec: ruby: not found
```
even i've set the rbenv local ***

i think it need do something like
```bash
eval "$(rbenv init -)"
```

but ~/.ssh/environment not support this kind of script.
what is the best solution for this?

Thanks.