rbenv: rbenv shell command not found

Environment:

$ uname -srvm
Linux 3.11.0-11-generic #17-Ubuntu SMP Tue Oct 1 19:42:04 UTC 2013 x86_64
$ echo $SHELL
/usr/bin/fish
$ rbenv --version
rbenv 0.4.0-65-gff23666

When I execute rbenv shell jruby-1.7.4 rbenv outputs rbenv: no such command `shell’ and the ruby environment doesn’t change.

In order to mitigate this issue I’m using this:

function rbenv-shell
  set --local RUBY_VERSION $argv[1]

  if test "$RUBY_VERSION" = "--unset"
    set --global --export --erase RBENV_VERSION
  else if test -n "$RUBY_VERSION"
    set --global --export RBENV_VERSION $RUBY_VERSION
  end

  rbenv version
end
complete --command rbenv-shell --exclusive --arguments "--unset (rbenv versions --bare)"

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 20 (7 by maintainers)

Commits related to this issue

Most upvoted comments

How did you set up rbenv? Did you follow instructions from the official README? Do you have this line in your .bash_profile or .zshrc (depending on the shell you use):

eval "$(rbenv init -)"

rbenv shell is a special command that only works if you’ve set up the rbenv() function in your shell by means of eval’ing rbenv init - output.