mardi 21 janvier 2020

Ruby - Rails - RVM or Rbenv only one version of Ruby can work

I have two projects, one using ruby-2.7.0, the other using ruby-2.6.5.

I've just realized there is a weird issue with my Ruby/Rails setup on the latest OS X. Either using RVM or Rbenv, every time I installed over two versions of ruby, only one version ends up working (2.7.0). The bundle as well as gem commands on the other will no longer work but give a Traceback....(RuntimeError).

In the past 6 hours, I have reinstalled rbenv, uninstalled rbenv, installed rvm. I've also tried uninstalling all non-system Ruby versions and Rails as well. Nothing seems to help.

Below is the error shown in my console:

(base) ➜  ~ rvm list
=* ruby-2.6.5 [ x86_64 ]
   ruby-2.7.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

(base) ➜  ~ bundle -v
Traceback (most recent call last):
ruby: invalid option -:  (-h will show valid options) (RuntimeError)
(base) ➜  ~ gem -v
Traceback (most recent call last):
ruby: invalid option -:  (-h will show valid options) (RuntimeError)
(base) ➜  ~ rvm use 2.7.0
Using /Users/nahua/.rvm/gems/ruby-2.7.0
(base) ➜  ~ bundle -v
Bundler version 2.1.4
(base) ➜  ~ rvm use 2.6.5
Using /Users/nahua/.rvm/gems/ruby-2.6.5
Traceback (most recent call last):
ruby: invalid option -:  (-h will show valid options) (RuntimeError)

Please let me know what information I should provide in order to help you understand the problem better. Cheers!

Aucun commentaire:

Enregistrer un commentaire