質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

ただいまの
回答率

90.12%

Homebrewの Warning: Homebrew's sbin was not found in your PATH but you have installed formulae..が消えない

受付中

回答 1

投稿

  • 評価
  • クリップ 0
  • VIEW 239

DrqYuto

score 138

echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc


した後に、

source ~/.zshrc


しても。

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

と出ます。

環境は
echo $PATH
すると、

/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/local/sbin:/Users/user_name/.rbenv/versions/2.4.1/bin:/Users/kuguminatoyuto/.rbenv/shims:/usr/local/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/qt@5.5/bin:/Users/kuguminatoyuto/.pyenv/shims:/Users/kuguminatoyuto/.pyenv/bin:/Users/kuguminatoyuto/Library/Haskell/bin:/usr/local/opt/ghc@8.0/bin:/usr/local/opt/libpcap/bin:/usr/local/opt/ncurses/bin:/usr/local/opt/openssl@1.1/bin:/usr/local/var/pyenv/shims:/Users/kuguminatoyuto/.nodebrew/current/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin#openssl@1.1の設定

echo $SHELL
すると、

/bin/zsh

cat ~/.zshrc
すると、

export LANG=ja_JP.UTF-8

 autoload colors
 colors
 case ${UID} in
 0)
     PROMPT="%B%{${fg[green]}%}%/#%{${reset_color}%}%b "
         PROMPT2="%B%{${fg[green]}%}%_#%{${reset_color}%}%b "
             SPROMPT="%B%{${fg[green]}%}%r is correct? [n,y,a,e]:%{${reset_color}%}%b "
                 [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
                         PROMPT="%{${fg[cyan]}%}$(echo ${HOST%%.*} | tr '[a-z]' '[A-Z]') ${PROMPT}"
                             ;;
                             *)
                                 PROMPT="%{${fg[green]}%}%/%%%{${reset_color}%} "
                                     PROMPT2="%{${fg[green]}%}%_%%%{${reset_color}%} "
                                         SPROMPT="%{${fg[green]}%}%r is correct? [n,y,a,e]:%{${reset_color}%} "
                                             [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
                                                     PROMPT="%{${fg[cyan]}%}$(echo ${HOST%%.*} | tr '[a-z]' '[A-Z]') ${PROMPT}"
                                                         ;;
                                                         esac

                                                          case "${OSTYPE}" in
                                                          freebsd*|darwin*)
                                                              alias ls="ls -G -w"
                                                                  ;;
                                                                  linux*)
                                                                      alias ls="ls --color"
                                                                          ;;
                                                                          esac

                                                                          # Path to your oh-my-zsh installation.

export ZSH=/Users/kuguminatoyuto/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"

# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

# User configuration

export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

export PATH=$HOME/.nodebrew/current/bin:$PATH

export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi

# alias brew="env PATH=${PATH/\/Users\/kuguminatoyuto\/\.phpenv\/shims:/} brew"

alias brew="PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin brew"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"#openssl@1.1の設定
alias vi="vim"
#

alias sjis="iconv -f cp932"#ターミナルで SJIS の文字化けを避ける
export PATH="/usr/local/opt/ncurses/bin:$PATH"
export PATH="/usr/local/opt/libpcap/bin:$PATH"
export PATH="/usr/local/opt/ghc@8.0/bin:$PATH"
export PATH=$HOME/Library/Haskell/bin:$PATH
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
export PATH="/usr/local/opt/qt@5.5/bin:$PATH"
autoload -Uz colors
colors
PROMPT="%(?.%{${fg[green]}%}.%{${fg[red]}%})[%n@%m]%{${reset_color}%} %# "
printf '\e[9;1t'
p=$PATH;PATH=;/usr/libexec/path_helper -s >> ~/.zprofile;PATH=$p
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export PATH=/usr/local/bin:"$PATH"
eval "$(rbenv init -)"
path=(
  /usr/local/{bin,sbin}
    /Users/user_name/.rbenv/versions/2.4.1/bin
      $path
      )
alias history='fc -l'

export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/sbin:$PATH"
  • 気になる質問をクリップする

    クリップした質問は、後からいつでもマイページで確認できます。

    またクリップした質問に回答があった際、通知やメールを受け取ることができます。

    クリップを取り消します

  • 良い質問の評価を上げる

    以下のような質問は評価を上げましょう

    • 質問内容が明確
    • 自分も答えを知りたい
    • 質問者以外のユーザにも役立つ

    評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。

    質問の評価を上げたことを取り消します

  • 評価を下げられる数の上限に達しました

    評価を下げることができません

    • 1日5回まで評価を下げられます
    • 1日に1ユーザに対して2回まで評価を下げられます

    質問の評価を下げる

    teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。

    • プログラミングに関係のない質問
    • やってほしいことだけを記載した丸投げの質問
    • 問題・課題が含まれていない質問
    • 意図的に内容が抹消された質問
    • 広告と受け取られるような投稿

    評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。

    質問の評価を下げたことを取り消します

    この機能は開放されていません

    評価を下げる条件を満たしてません

    評価を下げる理由を選択してください

    詳細な説明はこちら

    上記に当てはまらず、質問内容が明確になっていない質問には「情報の追加・修正依頼」機能からコメントをしてください。

    質問の評価を下げる機能の利用条件

    この機能を利用するためには、以下の事項を行う必要があります。

回答 1

+1

https://teratail.com/questions/186322 と同じ状況ではないでしょうか。
.zshrcalias brew=の行を次のように変更するとどうでしょう。

alias brew='PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin brew'

投稿

  • 回答の評価を上げる

    以下のような回答は評価を上げましょう

    • 正しい回答
    • わかりやすい回答
    • ためになる回答

    評価が高い回答ほどページの上位に表示されます。

  • 回答の評価を下げる

    下記のような回答は推奨されていません。

    • 間違っている回答
    • 質問の回答になっていない投稿
    • スパムや攻撃的な表現を用いた投稿

    評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。

  • 2019/06/26 17:03

    なるほど。今は実機がないので週末試してみます。ありがとうございます。

    キャンセル

  • 2019/06/29 16:49

    122行目に挿入しましたが、brew doctorしてもダメで同じ結果でした。

    ```
    1 export LANG=ja_JP.UTF-8
    2
    3 autoload colors
    4 colors
    5 case ${UID} in
    6 0)
    7 PROMPT="%B%{${fg[green]}%}%/#%{${reset_color}%}%b "
    8 PROMPT2="%B%{${fg[green]}%}%_#%{${reset_color}%}%b "
    9 SPROMPT="%B%{${fg[green]}%}%r is correct? [n,y,a,e]:%{${reset_color}%}%b "
    10 [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
    11 PROMPT="%{${fg[cyan]}%}$(echo ${HOST%%.*} | tr '[a-z]' '[A-Z]') ${PROMPT}"
    12 ;;
    13 *)
    14 PROMPT="%{${fg[green]}%}%/%%%{${reset_color}%} "
    15 PROMPT2="%{${fg[green]}%}%_%%%{${reset_color}%} "
    16 SPROMPT="%{${fg[green]}%}%r is correct? [n,y,a,e]:%{${reset_color}%} "
    17 [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
    18 PROMPT="%{${fg[cyan]}%}$(echo ${HOST%%.*} | tr '[a-z]' '[A-Z]') ${PROMPT}"
    19 ;;
    20 esac
    21
    22 case "${OSTYPE}" in
    23 freebsd*|darwin*)
    24 alias ls="ls -G -w"
    25 ;;
    26 linux*)
    27 alias ls="ls --color"
    28 ;;
    29 esac
    30
    31 # Path to your oh-my-zsh installation.
    32
    33 export ZSH=/Users/kuguminatoyuto/.oh-my-zsh
    34
    35 # Set name of the theme to load.
    36 # Look in ~/.oh-my-zsh/themes/
    37 # Optionally, if you set this to "random", it'll load a random theme each
    38 # time that oh-my-zsh is loaded.
    39 ZSH_THEME="robbyrussell"
    40
    41 # Uncomment the following line to use case-sensitive completion.
    42 # CASE_SENSITIVE="true"
    43
    44 # Uncomment the following line to disable bi-weekly auto-update checks.
    45 # DISABLE_AUTO_UPDATE="true"
    46
    47 # Uncomment the following line to change how often to auto-update (in days).
    48 # export UPDATE_ZSH_DAYS=13
    49
    50 # Uncomment the following line to disable colors in ls.
    51 # DISABLE_LS_COLORS="true"
    52
    53 # Uncomment the following line to disable auto-setting terminal title.
    54 # DISABLE_AUTO_TITLE="true"
    55
    56 # Uncomment the following line to enable command auto-correction.
    57 # ENABLE_CORRECTION="true"
    58
    59 # Uncomment the following line to display red dots whilst waiting for completion.
    60 # COMPLETION_WAITING_DOTS="true"
    61
    62 # Uncomment the following line if you want to disable marking untracked files
    63 # under VCS as dirty. This makes repository status check for large repositories
    64 # much, much faster.
    65 # DISABLE_UNTRACKED_FILES_DIRTY="true"
    66
    67 # Uncomment the following line if you want to change the command execution time
    68 # stamp shown in the history command output.
    69 # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
    70
    71 # HIST_STAMPS="mm/dd/yyyy"
    72
    73 # Would you like to use another custom folder than $ZSH/custom?
    74 # ZSH_CUSTOM=/path/to/new-custom-folder
    75
    76 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
    77 # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
    78 # Example format: plugins=(rails git textmate ruby lighthouse)
    79 # Add wisely, as too many plugins slow down shell startup.
    80 plugins=(git)
    81
    82 # User configuration
    83
    84 export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    85 # export MANPATH="/usr/local/man:$MANPATH"
    86
    87 source $ZSH/oh-my-zsh.sh
    88
    89 # You may need to manually set your language environment
    90 # export LANG=en_US.UTF-8
    91
    92 # Preferred editor for local and remote sessions
    93 # if [[ -n $SSH_CONNECTION ]]; then
    94 # export EDITOR='vim'
    95 # else
    96 # export EDITOR='mvim'
    97 # fi
    98
    99 # Compilation flags
    100 # export ARCHFLAGS="-arch x86_64"
    101
    102 # ssh
    103 # export SSH_KEY_PATH="~/.ssh/dsa_id"
    104
    105 # Set personal aliases, overriding those provided by oh-my-zsh libs,
    106 # plugins, and themes. Aliases can be placed here, though oh-my-zsh
    107 # users are encouraged to define aliases within the ZSH_CUSTOM folder.
    108 # For a full list of active aliases, run `alias`.
    109 #
    110 # Example aliases
    111 # alias zshconfig="mate ~/.zshrc"
    112 # alias ohmyzsh="mate ~/.oh-my-zsh"
    113
    114 export PATH=$HOME/.nodebrew/current/bin:$PATH
    115
    116 export PYENV_ROOT=/usr/local/var/pyenv
    117 if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
    118
    119 # alias brew="env PATH=${PATH/\/Users\/kuguminatoyuto\/\.phpenv\/shims:/} brew"
    120
    121 alias brew="PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin brew"
    122 alias brew='PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin brew'
    123
    124 export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"#openssl@1.1の設定
    125 alias vi="vim"
    126 #
    127
    128 alias sjis="iconv -f cp932"#ターミナルで SJIS の文字化けを避ける
    129 export PATH="/usr/local/opt/ncurses/bin:$PATH"
    130 export PATH="/usr/local/opt/libpcap/bin:$PATH"
    131 export PATH="/usr/local/opt/ghc@8.0/bin:$PATH"
    132 export PATH=$HOME/Library/Haskell/bin:$PATH
    133 export PYENV_ROOT="$HOME/.pyenv"
    134 export PATH="$PYENV_ROOT/bin:$PATH"
    135 eval "$(pyenv init -)"
    136 export PATH="/usr/local/opt/qt@5.5/bin:$PATH"
    137 autoload -Uz colors
    138 colors
    139 PROMPT="%(?.%{${fg[green]}%}.%{${fg[red]}%})[%n@%m]%{${reset_color}%} %# "
    140 printf '\e[9;1t'
    141 p=$PATH;PATH=;/usr/libexec/path_helper -s >> ~/.zprofile;PATH=$p
    142 export PATH="/usr/local/opt/sqlite/bin:$PATH"
    143 export PATH=/usr/local/bin:"$PATH"
    144 eval "$(rbenv init -)"
    145 path=(
    146 /usr/local/{bin,sbin}
    147 /Users/user_name/.rbenv/versions/2.4.1/bin
    148 $path
    149 )
    150 alias history='fc -l'
    151
    152 export PATH="/usr/local/sbin:$PATH"
    153 export PATH="/usr/local/sbin:$PATH"
    154 export PATH="/usr/local/sbin:$PATH"
    155 export PATH="/usr/local/sbin:$PATH"
    ```

    キャンセル

15分調べてもわからないことは、teratailで質問しよう!

  • ただいまの回答率 90.12%
  • 質問をまとめることで、思考を整理して素早く解決
  • テンプレート機能で、簡単に質問をまとめられる