简体   繁体   中英

Installing the Correct Ruby / rbenz for new Macbook Air (M1) for Appacademy

I am starting the appacademy open course and am trying to get Ruby set up the way they want. I've followed their instructions installing rbenz. I installed rbenz 2.7.2 because i hear this is compatible with the new M1 chips. Everything seems to have worked. However, when I check the ruby version (ruby -v) I run into a repeating error:

/Users/raylang/.rbenv/shims/ruby: line 3: =: command not found
/Users/raylang/.rbenv/shims/ruby: line 3: =: command not found
/Users/raylang/.rbenv/shims/ruby: line 3: =: command not found```



It's weird because it tells me that I have installed it already:

```Installed openssl-1.1.1k to /Users/raylang/.rbenv/versions/2.7.2

Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...
ruby-build: using readline from homebrew
Installed ruby-2.7.2 to /Users/raylang/.rbenv/versions/2.7.2```


Any ideas anyone?

I guess you installed rbenv with homebrew

Did you update your.bashrc or.zshrc?

if not yet, add following

# rbenv
export PATH="~/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="~/.rbenv/shims:/usr/local/bin:$PATH"

then restart terminal.

After that set global ruby version.

rbenv global x.x.x # 2.7.2 etc.

Then you can use ruby -v

for more information: https://github.com/rbenv/rbenv#installation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM