Mac OS
I was working with Ruby 2.7.0 and Rails 6, but a few gems, as well as dependencies, are not Ruby 2.7.0 compliant, and was getting a ton of warning messages. So, I decided to un-install Ruby 2.7.0
rbenv uninstall 2.7.0
rbenv install 2.6.3
Now, whenever I try to do anything, I get the following error message:
ruby: invalid option -: (-h will show valid options) (RuntimeError)
Even if I'm doing something as simple as:
ruby -v
From my terminal:
unset RUBYOPT
Everything works fine, until the next time I go into terminal. While I may be able to work around it, on my development machine, from terminal, my IDE doesn't understand this, and generated the same error, whenever I do Rake, from the IDE.
When I set rbenv up, it inserted the following, into my .bash_profile:
export RUBYOPT='-W:no-deprecated -W:no-experimental'
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
Any ideas?
Solution:
I removed the following statement, that was added by rbenv to my .bash_profile:
export RUBYOPT='-W:no-deprecated -W:no-experimental'
and it's working fine now