Rails error

Updated 11 October 2026

Short answer

In production, Rails shows a generic "We're sorry, but something went wrong" page and writes the details to its log. By default that's in your app's log/ folder, named after the environment, so log/production.log. On platforms like Heroku, logs go to the platform's log stream instead. Find the exception for the failing request. The usual causes are migrations that didn't run, missing credentials or environment variables, or assets not compiled.

What's the problem

Your Rails app shows "We're sorry, but something went wrong" (500), "The page you were looking for doesn't exist" (404), or fails to boot after a deploy.

Why it happens

  • Pending migrations on production.
  • Missing credentials or environment variables, such as the master key.
  • Assets not precompiled.
  • An exception in a controller or view, often a database or API call.
  • Gem or Ruby version changes.
  • The app server (Puma) crashed behind Nginx (502).

How to fix it

  1. Read log/production.log (or your platform's logs) for the exception.
  2. Run migrations on production.
  3. Check credentials and environment variables.
  4. Precompile assets as part of the deploy.
  5. Check the app server is running and restart it.
  6. Roll back if a deploy caused it.

What Preventionlabs checks

One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go; up to 50 pages from your sitemap, listing any that fail or are slow, plus broken links on them. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; recent deploys and account changes, with their times. It doesn't read your server logs, so the exact error message is in your host's logs.

Run your free report

Your first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.

Sources

  1. Ruby on Rails: Debugging Rails Applicationsofficial docsBy default, each log is created under Rails.root/log/ and the log file is named after the environment in which the application is running.

Preventionlabs is independent and not affiliated with Ruby on Rails. Product names are used only to describe the problem.

← All of Frameworks