Equivalent of `heroku run rails c`

Maybe I’m not seeing it in the docs, but I’m looking for console access to apps.

Even when I ssh into the app, bundle doesn’t appear to be installed or in the PATH. Navigating directly to the app’s path and runnings rails also gives an error that rails is not installed.

What am I doing wrong?

1 Like

I’m running a Rails app that I just moved over from Heroku. I can open the Shell and I’m in the app root directory. I can run rails c. I haven’t set up ssh yet, though. AFAIK, there’s an API endpoint that will run a command in the container. But if you get ssh working, you should be able to non-interactively run a command that way too.

Hi there,

Thanks for reaching out.

This sounds like you have a service created with the Heroku migration tool. Due to the way we recreate a Heroku-based app in Docker, you’d need to run source ./.profile.d/ruby.sh in the “Shell” each time to configure the environment with the required paths, etc. After that, you should be able to run rails as normal.

If your app doesn’t require any custom OS-level packages, or niche environment configuration, you may want to try spinning up your app on a Native Environment to avoid some of the extra steps that arise with a migrated Docker setup. For one, this would negate the source... .

Hope that helps

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.