简体   繁体   中英

RVM + ZSH + OSX Problems

I have installed rvm using the instructions on the website .

I have also added the required following to mt .zshrc:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" 

Now, when i run rvm, i get the following error:

__rvm_rm_rf:local:2: path: can't assign initial value for array

The next time i run rvm i get:

__rvm_conditionally_add_bin_path:2: command not found: grep
__rvm_rm_rf:local:2: path: can't assign initial value for array
rvm:26: command not found: cat

Now at this point, nothing works. Including basic commands like cat. If I look at $PATH, it doesnt exist anymore, explaining why commands dont work.

If I execute /bin/bash, I can execute rvm just fine...

Not sure where to go next.

These scripts use a lot of advanced bash features. Zsh has a lot of them, but some work slightly differently despite having the same syntax, and others have different syntax. It's possible to write scripts that work in both shells, but that requires care and constant testing.

As it happens, the author just fixed this particular bug:

commit d7005e0dbb37964e42ead68551a03b7646c473fc
Author: Conrad Irwin
Date: Sat Feb 26 19:48:30 2011 -0800

 Rename $path to $target in __rvm_rm_rf Using $path overrides the global $path variable under zsh. Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> 

If you run into other issues, take it up with the author. Maintaining scripts that work in both bash and zsh is a lot of work, so it's a matter of whether he's prepared to do this work, perhaps with your assistance as a tester.

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