LoginSignup
0
1

More than 1 year has passed since last update.

.rbenv/shims/docker-sync: line 21: /usr/local/Cellar/rbenv/1.1.2/libexec/rbenv: No such file or directory

Last updated at Posted at 2021-10-09

はじめに

brew upgradeしたらdocker-sync だけ見つからなくなりました。
gemで入れたもの全部動かなくなった(全部は確認してないけど)
探しても対処法がぱっと見つからなかった(ちゃんと探してないだけ)のでメモがてら書きます。

結論(解決した方法)

以下を実行で解決した。

rbenv rehash

rbenv rehash コマンドを実行すると、大まかには ~/.rbenv/versions/*/bin/ 以下のファイルを ~/.rbenv/shims/ 以下にコピーする。

なぜコピーする必要があるかというと、通常PATHが通っているのは ~/.rbenv/shims 以下となっているからで、ここにコピーしないと rspec とか rubocop といったGemが提供するコマンドを実行できないからである。

cf. https://mogulla3.tech/articles/2020-12-29-01

ということみたいです。

やったこと

brewのupdate, upgradeがうまくいってない?

brew update && brew upgrade

全て最新になってるっぽい。

brewで問題が起きている?

brew doctor

dockerのlinkができてないというのが出たので、link

brew link docker

でも、直らない。他に問題はなさそう。

rbenvの問題?

brew reinstall rbenv

まだ問題変わらず、、

??

----- ここから下を確認して実行すればOK -----

/usr/local/Cellar/rbenv/1.1.2/libexec/rbenv: No such file or director

rbenv/1.1.2?

rbenvのバージョン見てみる

rbenv -v
=> rbenv 1.2.0

バージョンが違う、、

ll /usr/local/Cellar/rbenv                                                                                                                                                                                                      
total 0
drwxr-xr-x  10 kazmaw  admin   320B 10  9 10:07 1.2.0

rbenv/1.1.2なんてないじゃないか。

brew ls --formula -lt | grep rbenv                                                                                                                                                                                             
drwxr-xr-x  3 kazmaw  admin  96 Oct  9 10:07 rbenv

rbenvのバージョンが上がってしまったからか、、
gemも動かない事に気づいた

gem uninstall docker-sync                                                                                                                                                                                                       
/()/.rbenv/shims/gem: line 21: /usr/local/Cellar/rbenv/1.1.2/libexec/rbenv: No such file or directory

あー、rbenvのパス通すやつなんかあったな、、

rbenv rehash
 ❯ docker-sync -h                                                                                                                                                                                                                           [10:32:08]
Commands:
  docker-sync --version, -v   # Prints out the version of docker-sync and exits
  docker-sync clean           # Stop and clean up all sync endpoints
  docker-sync help [COMMAND]  # Describe available commands or one specific command
  docker-sync list            # List all sync-points of the project configuration path
  docker-sync logs            # Prints last 100 lines of daemon log. Only for use with docker-sync started in background.
  docker-sync restart         # Restart docker-sync daemon
  docker-sync start           # Start all sync configurations in this project
  docker-sync stop            # Stop docker-sync daemon
  docker-sync sync            # just sync - do not start a watcher though

Options:
  -c, [--config=CONFIG]            # Path of the docker_sync config
  -n, [--sync-name=SYNC_NAME]      # If given, only this sync configuration will be references/started/synced
  -v, [--version], [--no-version]  # prints out the version of docker-sync and exits

いけたーー!

0
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
0
1