##環境
Docker version 20.10.7, build f0df350
docker-compose version 1.29.2, build 5becea4c
##状況
$ docker-compose exec app rails -v
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "rails": executable file not found in $PATH: unknown
##解決方法
railsコマンド前にbundle execをつける
$ docker-compose exec app bundle exec rails -v
Rails 6.1.3.2
##参考