I installed ruby 2.0 into ~/.rbenv/versions last and now nothing but that is available
$ rbenv versions
system
*ruby-1.9.3-p392 (set by /apps/test_app/.ruby-version)
ruby-2.0.0-p0
$ ruby -v
ruby 2.0.0.p0
$ env | grep PATH
PATH=/home/cbron/.rbenv/shims:/home/cbron/.rbenv/bin
$cat ~/.bash_profile
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
$rbenv global
ruby-1.9.3-p392
$rbenv local
ruby-1.9.3-p392
$rbenv shell
rbenv: no shell-specific version configured
edit: now set the shell, still nothing.
$rbenv shell
ruby-1.9.3-p392
ruby -v still getting
ruby 2.0.0p0
I already sourced my bash_profile, even restarted the computer.
I had the same issue using zsh and this fixed it:
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
$ echo 'source $HOME/.zshenv' >> ~/.zshrc
$ exec $SHELL
So basically moving the lines from profile to env!
Extracted from rbenv readme:
rbenv shell
Sets a shell-specific Ruby version by setting the
RBENV_VERSION
environment variable in your shell. This version overrides application-specific versions and the global version.$ rbenv shell jruby-1.7.1
When run without a version number,
rbenv shell
reports the current value ofRBENV_VERSION
. You can also unset the shell version:$ rbenv shell --unset
Note that you'll need rbenv's shell integration enabled (step 3 of the installation instructions) in order to use this command. If you prefer not to use shell integration, you may simply set the
RBENV_VERSION
variable yourself:$ export RBENV_VERSION=jruby-1.7.1
So in order to use it you need to specify the ruby version as rbenv shell
argument (f.e. rbenv shell 2.0.0.p0
, or set RBENV_VERSION
(f.e. export RBENV_VERSION=2.0.0.p0
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With