LoginSignup
1
1

More than 5 years have passed since last update.

ターミナル起動時にrbenvのPATHエラーが表示される対処

Last updated at Posted at 2019-06-22
  • ターミナル起動時に以下のエラーが表示される。
Last login: Sat Apr 29 18:13:19 on ttys000
-bash: export: `export PATH="/Users/自分のユーザーネーム$ /.rbenv/shims:${PATH}"
export RBENV_SHELL=bash
source '/usr/local/Cellar/rbenv/1.1.0/libexec/../completions/rbenv.bash'
command rbenv rehash 2>/dev/null
rbenv() {
  local command
  command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  rehash|shell)
    eval "$(rbenv "sh-$command" "$@")";;
  *)
    command rbenv "$command" "$@";;
  esac
}': not a valid identifier
-bash: touch: command not found
MacBook-Pro:~ 自分のユーザーネーム$ $ 
  • まず最初にパスを確認するため、.bash_profileファイルをテキストエディタで開く。
  • .bash_profileは隠しファイルなので、Finder上でcommand + shift + .を同時に押すことで確認できる。
  • ファイルを開いたら、以下のようになっていた。
export PATH=/usr/local/bin:/usr/local/sbin:$PATHeval "$(rbenv init -)"
export PATH="/usr/local/opt/mysql@5.6/bin:$PATH"
export PATH="/usr/local/opt/mysql@5.6/bin:$PATH"
eval "$(rbenv init -)"
  • ここで注目すべきなのが1行目。 export ~ $PATHeval "$(rbenv init -)"は別の行にあるべきものなのにくっついて書かれている。今回は4行目にrbenvのパスがあるので1行目を削除したらエラーは表示されなくなった。

参考サイト: Macのターミナルで起動画面時に以下のようなエラーがでてきてしまいました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1