2011-08-19 92 views
9

嗨,我只是按照我的Mac迷你服務器運行OSX Lion 服務器的thinkbot筆記本電腦安裝程序。我不確定一切安裝是否正確。請指教。用於zsh的brew安裝?

我沒有在〜/ .bash_profile或〜/ .bashrc中,但我有一個〜/ .profile文件

但這裏是.zshrc內容,因爲我用.zsh。

1 # load our own completion functions 
    2 fpath=(~/.zsh/completion $fpath) 
    3 
    4 # completion 
    5 autoload -U compinit 
    6 compinit 
    7 
    8 # automatically enter directories without cd 
    9 setopt auto_cd 
    10 
    11 # use vim as an editor 
    12 export EDITOR=vim 
    13 
    14 # aliases 
    15 if [ -e "$HOME/.aliases" ]; then 
    16 source "$HOME/.aliases" 
    17 fi 
    18 
    19 # vi mode 
    20 bindkey -v 
    21 bindkey "^F" vi-cmd-mode 
    22 bindkey jj vi-cmd-mode 
    23 
    24 # use incremental search 
    25 bindkey "^R" history-incremental-search-backward 
    26 
    27 # add some readline keys back 
    28 bindkey "^A" beginning-of-line 
    29 bindkey "^E" end-of-line 
    30 
    31 # handy keybindings 
    32 bindkey "^P" history-search-backward 
    33 bindkey "^Y" accept-and-hold 
    34 bindkey "^N" insert-last-word 
    35 bindkey -s "^T" "^[Isudo ^[A" # "t" for "toughguy" 
    36 
    37 # expand functions in the prompt 
    38 setopt prompt_subst 
    39 
    40 # prompt 
    41 export PS1='[${SSH_CONNECTION+"%[email protected]%m:"}%~] ' 
    42 
    43 # ignore duplicate history entries 
    44 setopt histignoredups 
    45 
    46 # keep TONS of history 
    47 export HISTSIZE=4096 
    48 
    49 # look for ey config in project dirs 
    50 export EYRC=./.eyrc 
    51 
    52 # automatically pushd 
    53 setopt auto_pushd 
    54 export dirstacksize=5 
    55 
    56 # awesome cd movements from zshkit 
    57 setopt AUTOCD 
    58 setopt AUTOPUSHD PUSHDMINUS PUSHDSILENT PUSHDTOHOME 
    59 setopt cdablevars 
    60 
    61 # Try to correct command line spelling 
    62 setopt CORRECT CORRECT_ALL 
    63 
    64 # Enable extended globbing 
    65 setopt EXTENDED_GLOB 
    66 
    67 # RVM 
    68 [[ -s '/Users/pma/.rvm/scripts/rvm' ]] && source '/Users/pma/.rvm/scripts/rvm' 

啤酒釀造與醫生抱怨

[~] brew doctor 
/usr/bin is in your PATH before Homebrew's bin. This means that system- 
provided programs will be used before Homebrew-provided ones. This is an 
issue if you install, for instance, Python. 

Consider editing your .bashrc to put: 
    /usr/local/bin 
ahead of /usr/bin in your $PATH. 

的zsh:

[~] zsh --version 
zsh --version 
zsh 4.3.11 (i386-apple-darwin11.0) 

那麼,怎樣才能保證我BREW是正確安裝和BREW醫生移除錯誤?

+0

'echo $ PATH'的輸出是什麼 –

+0

[〜] echo $ PATH /Users/pma/.rvm/gems/ruby-1.9.2-p290/bin:/Users/pma/.rvm/gems/ [email protected]/bin:/Users/pma/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/pma/.rvm/bin:在/ usr/bin中:/ bin中:/usr/sbin:/ sbin:/ usr/local/bin:/ usr/X11/bin –

回答

22

嘗試在你的.zshrc

export PATH=/usr/local/bin:$PATH 
5

這個工作對我來說這行:

export PATH="/usr/local/bin:$PATH" >> ~/.zshrc 
1

我用ohmyzsh。進入目錄

cd /usr/local/bin 
brew doctor 

你會發現它顯示了類似的警告:

Warning: You have unlinked kegs in your Cellar 
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on 
those kegs to fail to run properly once built. Run `brew link` on these: 
autoconf 
automake 
gdbm 
gnupg 
libgpg-error 
libksba 
libtool 
libyaml 
mongodb 
node 
pcre 
pkg-config 
zsh 

你將不得不在這裏運行一個命令:

brew link zsh 

對我來說該鏈接它。

+0

非常感謝你的發帖,你幫了我很多!我永遠使用osx終端然後安裝了brew,我的所有軟件包都無法正常工作。我不得不運行「釀造醫生」來修復。 –