2011-08-19 41 views
9

Xin chào, tôi vừa theo dõi thiết lập máy tính xách tay Thinkbot cho Máy chủ Mac Mini của tôi chạy OSX Lion Máy chủ. Tôi không chắc chắn rằng mọi thứ được cài đặt đúng. Xin cho biết.cài đặt bia cho zsh?

Tôi không có một ~/.bash_profile hoặc ~/.bashrc nhưng tôi có một ~/.profile

Nhưng đây là nội dung cho zshrc kể từ khi tôi sử dụng .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 than phiền với bác sĩ brew

[~] 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) 

Vì vậy, làm thế nào tôi có thể đảm bảo brew được cài đặt một cách chính xác và loại bỏ các lỗi từ bác sĩ brew?

+0

Đầu ra của 'echo $ PATH' –

+0

[~] echo $ PATH /Users/pma/.rvm/gems/ruby-1.9.2-p290/bin:/Users/pma/.rvm/gems/ là gì [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 –

Trả lời

22

Cố gắng thiết lập dòng này trong thư mục .zshrc

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

này đã làm việc cho tôi:

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

tôi sử dụng ohmyzsh. Tới thư mục

cd /usr/local/bin 
brew doctor 

Bạn sẽ thấy nó hiển thị cảnh báo như:

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 

Bạn sẽ phải chạy một lệnh ở đây:

brew link zsh 

Và đó liên kết nó cho tôi.

+0

Cảm ơn bạn đã đăng bài, bạn đã giúp tôi rất nhiều! Tôi sử dụng thiết bị đầu cuối osx mãi mãi sau đó cài đặt brew và tất cả các gói của tôi đã không làm việc. Tôi phải chạy 'brew doctor' để sửa chữa. –