How to debug a rails app in docker with pry?

If you’re using docker-compose, you can add these flags to docker-compose.yml:

app:
  tty: true
  stdin_open: true

And then attach to your process with docker attach project_app_1. pry-rails works here now. Ensure less is installed on your container for the optimal pry experience.

cf. https://github.com/docker/compose/issues/423#issuecomment-141995398

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)