How can I switch to ruby 1.9.3 installed using Hom

2019-01-07 04:05发布

I have installed ruby 1.9.3 using hombrew

brew install ruby

But default 1.8.7 is still used. How can I switch osx to use 1.9.3 as default ruby?

7条回答
Deceive 欺骗
2楼-- · 2019-01-07 04:37

I had similar situation. I installed ruby using Homebrew. which -a ruby gave me the following output:

#usr/local/bin/ruby
#/usr/bin/ruby

Which means that newly installed version should have been used, but ruby --version still returned the old system version.

I quit terminal (Cmd+Q), and after restart ruby --version returned the correct version. So make sure you restart terminal after installing before trying any other (potentially unnecessary) fixes.

查看更多
登录 后发表回答