English 中文(简体)
安装后未更新的Ruby
原标题:Ruby version not updating after install
  • 时间:2022-09-14 19:02:08
  •  标签:
  • ruby

我成功地将废墟版本安装到2.7,但ruby -v。 无需更新。 见以下产出:

➜  ~ ruby -v
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

1. 证明已安装了Rub 2.7:

➜  ~ brew install [email protected]                        
Warning: [email protected] 2.7.6_1 is already installed and up-to-date.
To reinstall 2.7.6_1, run:
  brew reinstall [email protected]

我失踪了什么?

最佳回答

<打碎的类型说明从哪里发现可以执行。

$ which ruby
/opt/homebrew/opt/ruby/bin/ruby

该校将载于<条码>/opt/homebrew/opt/ruby/bin/ruby。 如上所示,但是如果这不走你的道路,那么它就会走到系统。

$ which ruby
/usr/bin/ruby

在此情况下,请在您的<条码/代码>上添加行文 rub本目录。 我的<编码>bashrc有:

export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH"
问题回答

https://stackoverflow.com/a/12287926/17771995”

Assume my Mac use Zshell, 它为我工作。

  1. find .zshrc file, add this line below and then save it.
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
  1. run in terminal
source ~/.zshrc




相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签