Since the Ruby version did not switch in rbenv, it is a memo of it.
It does not change even if you switch the version with rbenv
$ rbenv versions
system
2.6.6
* 2.7.1 (set by RBENV_VERSION environment variable)
$ rbenv global 2.6.6
$ rbenv versions
system
2.6.6
* 2.7.1 (set by RBENV_VERSION environment variable)
It says set by RBENV_VERSION environment variable
, but I haven't written it anywhere.
Also, if you do export RBENV_VERSION = 2.6.6
in .zshrc
, the version of rbenv will change well,
I get an error when I try to check the version of ruby.
$ rbenv versions
system
* 2.6.6 (set by RBENV_VERSION environment variable)
2.7.1
$ ruby -v
/Users/naoto.koyama/.rbenv/versions/2.7.1/bin/ruby: invalid option -: (-h will show valid options) (RuntimeError)
It was caused by writing the RUBYOPT setting written in .zshrc
to suppress the Ruby 2.7 warning.
$ cat ~/.zshrc
...
export RUBYOPT='-W:no-deprecated -W:no-experimental' # <-This is the cause
If you delete the above and then type the following command, it's OK.
$ unset RUBYOPT
$ rbenv global 2.6.6
$ rbenv versions
system
* 2.6.6 (set by /Users/naoto.koyama/workspace/portal/.ruby-version)
2.7.1
$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin20]
Recommended Posts