Zsh error: export: 54: not valid in this context:

While messing with zsh today and getting something correctly configured for ruby, I got the following error.

/Users/secallahan/.zshrc:export:54: not valid in this context: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin

Here is my .zshrc (around line 54 where the error occurs) that I edited.

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh

....
....

# User configuration

export $PATH=/Users/secallahan/.rvm/gems/ruby-2.1.1/bin:/Users/secallahan/.rvm/gems/ruby-2.1.1@global/bin:/Users/secallahan/.rvm/rubies/ruby-2.1.1/bin:/Users/secallahan/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin
# export MANPATH="/usr/local/man:$MANPATH"

That was the only way I could do this. So, I opened a new shell and did ruby -vand got ruby2.1.1 as the current version.

Any help would be greatly appreciated.

+4
source share
1 answer

When defining or exporting a variable, you should not use $:

export PATH=/Users...

Otherwise, the current value PATHwill be replaced by the operator export.

+13

Source: https://habr.com/ru/post/1531680/


All Articles