Skip to main content
Languages

Ruby

Judge it through the Rails product and upgrade path you will own.

A Rails application has supported a business for years and still moves customer orders, subscriptions or internal work. Feature delivery is slowing because Ruby, Rails and several gems are behind their supported lines. The decision to make is whether the product can be brought onto a maintainable path without losing the behaviour the business depends on.

For a new product, the same question runs forward: do Rails conventions and the team’s Ruby capability reduce enough delivery work to justify the runtime and upgrade estate? Ruby is most useful when judged through that complete product system rather than through syntax alone.

Ruby’s commercial case is usually a Rails application

Ruby is a capable scripting language, but Rails is the reason most organisations operate it as a customer-facing platform. Rails supplies conventions for HTTP routing, persistence, migrations, jobs, mail, testing and security controls. That integrated route can help a small team deliver a substantial product.

The choice should therefore name the framework, database, queue, asset route, runtime and deployment model. Saying “we use Ruby” leaves too much of the operating commitment undefined.

For an inherited application, the Rails version and gem graph reveal more than language age. A well-tested application on a recent line can be a safer asset than a newer stack with unclear behaviour. An unsupported framework with abandoned extensions needs action even if the code continues to run.

Rails conventions reduce decisions while the codebase respects them

Rails is productive when engineers can find behaviour where the framework says it should be. Controllers coordinate requests, models protect domain rules and persistence, jobs own deferred work, and configuration stays explicit.

Over time, callbacks, concerns, monkey patches and metaprogramming can make a change trigger work far from the edited file. The code remains concise but becomes harder to predict. We first expose those hidden paths with tests and instrumentation, then move important behaviour into named objects with clear inputs and side effects.

This is not a campaign to make Ruby look like another language. Expressive code is valuable. The standard is whether a new maintainer can discover what happens, change it safely and diagnose it in production.

Dynamic code needs strong tests at business boundaries

Ruby’s dynamic type system supports quick composition and readable domain code. It also means many incorrect method names, unexpected nil values and shape mismatches appear only when the path executes.

We put high-value behaviour under tests that describe outcomes: pricing, permissions, state changes, payments and data exports. Request and system tests cover framework wiring. Unit tests cover rules with small inputs. Contract tests protect integrations whose payloads can change independently.

Coverage percentage is a clue and proves little on its own. A legacy suite can execute many lines while asserting little. Before an upgrade, we identify critical journeys, add characterisation tests around their current behaviour and record where manual verification is still required.

Bundler makes the gem graph part of each release

The Gemfile states intent and Gemfile.lock records the resolved dependency set. Both belong in version control. Production should install that locked graph rather than choose newer transitive gems during a deploy.

We review gem maintenance, native extensions, licences and framework constraints before adoption. A convenient authentication, file-processing or payment gem can become the limiting factor in the next Ruby or Rails upgrade. Git-sourced forks and private patches are given owners and an exit plan.

Updates move in bounded groups with tests and release notes. A broad bundle update on an old application changes too many variables at once and makes a regression expensive to locate.

Active Record queries need SQL evidence

Active Record makes common reads and writes concise, but association access can issue queries at execution time. A view that looks harmless may create an N+1 pattern across hundreds of records. Eager loading can reduce round trips while increasing rows and memory if the shape is chosen carelessly.

We inspect logs and query plans for important endpoints, test query counts where regressions matter and use projections for read-heavy paths. Database constraints protect invariants across every writer; model validation alone cannot do that.

Schema migrations are production releases. Large table changes, backfills and index creation are planned against the capabilities and traffic of the actual database, with application compatibility maintained during rollout.

Background jobs create a second execution path

Moving work to Active Job can shorten a request, but it does not make the work reliable by default. The queue adapter, retry policy, concurrency, ordering and worker deployment become part of the product.

Jobs should tolerate an expected retry and avoid serialising large or unstable objects. We pass identifiers, reload current state and make side effects idempotent where possible. A payment capture, email and data export need different retry and duplication policies.

Workers may run old application code after a deployment unless restart behaviour is explicit. Queue depth, age, failure and dead-letter handling require monitoring alongside web latency and errors.

Supported Ruby and Rails versions are a rolling obligation

Ruby and Rails publish separate maintenance states. A supported Rails line can still be paired with an old Ruby, and a current Ruby does not bring an end-of-life Rails application back into support.

We keep both calendars in the technology register and include the database, queue adapter and deployment image. Security support is the latest acceptable completion date, not the date to start investigating compatibility.

Staying close to maintained lines preserves working upgrade tools, documentation and gem support. It also makes each step small enough to combine with normal product delivery instead of asking for a large rescue budget every few years.

Major Rails upgrades should move in observable stages

Rails provides upgrade tasks, compatibility defaults and release guides that support incremental movement. We use them one supported boundary at a time, resolve deprecations and keep the application deployable after each stage.

The first stage is often inventory rather than code: Ruby and Rails versions, direct and transitive gems, custom patches, asset pipeline, job adapter, database extensions and external services. We establish a repeatable production-like environment before changing the platform.

After each step, automated and manual journeys run, then a controlled production release is compared for errors, jobs, latency and database load. This produces a sequence of reversible decisions. A rewrite remains an option for a capability whose boundaries and behaviour are now understood; starting one before that discovery repeats the risk the stages were meant to remove.

Questions to answer before approving Ruby

  • Is Rails the product advantage, or is Ruby being added for isolated scripting?
  • Which Ruby and Rails lines are in support, and when must they move again?
  • Can the application install from its lockfile on a clean build environment?
  • Which gems are abandoned, forked, native or blocking the next upgrade?
  • Do tests protect critical business journeys rather than inflate coverage?
  • Which endpoints need query-count, plan and memory evidence?
  • Are jobs safe to retry, observable and restarted during deployment?
  • Can a major upgrade be released in small stages with a credible rollback?

When Ruby is a sound product language

Ruby is a strong choice when Rails gives a capable team a coherent route from product idea to maintained web application. It is also a rational language to retain when an existing Rails system carries valuable, tested behaviour and can be kept within support.

The framework’s conventions, extensive libraries and readable domain code can support a business for many years. That longevity depends on regular dependency and platform work being treated as product maintenance.

When Ruby is being preserved without a product reason

Ruby is a weak addition when the organisation has no Ruby capability, Rails contributes little to the workload and an established stack already covers the problem. A collection of small scripts can also become an accidental platform if nobody owns its gems and runtime.

For an old Rails application, “rewrite it all” and “never touch it” are both poor default positions. Stabilise the current behaviour, measure the upgrade constraints and move bounded capabilities only where the evidence favours it. Legacy modernisation succeeds when each release reduces dependency on unsupported technology while continuing to serve the business.

Alexander De Sousa, Founder of Digital Royalty
Developer’s verdict

Keep Ruby when Rails is earning its place, and make supported versions part of normal product work.

I would not rewrite a Rails application because the stack is old, and I would not leave it untouched because an upgrade looks difficult. I first protect the business journeys, map the gem and integration constraints and get the current system observable. Then I move Ruby, Rails and dependencies in controlled stages. For a new product, Rails has to give the team a meaningful delivery advantage. When it does, Ruby is a sound choice. When it does not, adding another runtime is avoidable ownership.

Alexander De Sousa · Founder, Digital Royalty · LinkedIn

Decision evidence

What makes a Ruby and Rails product maintainable

Rails can give a small team a complete web product route. Tests, gem ownership, database evidence, reliable jobs and routine version movement keep that advantage intact.

The Ruby commitment in six decisions

Best fit
Rails web products and existing Ruby systems whose integrated framework and proven behaviour provide a clear business advantage.
Product effect
Fast delivery through conventions, with maintainability tied to tests, gem health, query discipline and regular platform upgrades.
Adoption cost
Moderate for a capable Rails team; high for an organisation adding a separate Ruby runtime, deployment route and support rota.
Ongoing owner
Ruby engineers responsible for framework and runtime support, gems, database behaviour, queues, deployment, security and diagnostics.
Exit cost
High for a Rails monolith with callbacks and shared data; lower when business capabilities have tests and stable interface boundaries.
Main risk
Deferring small Ruby, Rails and gem updates until unsupported dependencies force a large modernisation under time pressure.

Product routes to compare around Ruby and Rails

  • Modernise the current Rails product

    Right when: Choose when the application contains valuable behaviour and can return to a supported Ruby, Rails and gem route in stages.

    Watch for: Preserves working product knowledge while requiring test, dependency and deployment investment before feature pace improves.

  • Build a new Rails application

    Right when: Choose when the team knows Rails and its conventions remove material product and integration work.

    Watch for: Coherent full-stack delivery with an ongoing Ruby, Rails and gem upgrade calendar.

  • Use Laravel and PHP

    Right when: Choose when the organisation already supports PHP and wants similar full-stack web conventions without adding Ruby operations.

    Watch for: Consolidates the supported estate, while a Rails migration still requires careful behavioural and data equivalence work.

  • Extract bounded services

    Right when: Choose when selected high-change capabilities need a different stack while the stable Rails core should continue serving the business.

    Watch for: Reduces migration risk, but creates contracts and distributed operations that need explicit ownership.

Research behind this Ruby position

  • Official runtime lifecycle
    Ruby maintenance branches

    Publishes normal maintenance, security maintenance and end-of-life status for Ruby release lines, giving production runtimes visible deadlines.

  • Official framework lifecycle
    Rails maintenance policy

    Separates feature, bug-fix and security support and states what application owners inherit after a Rails line reaches end of life.

  • Official upgrade guidance
    Upgrading Ruby on Rails

    Recommends test coverage and supports gradual adoption of new framework defaults across several releases.

  • Dependency tooling
    Bundler deployment guide

    Requires the Gemfile and lockfile in source control so production installs the dependency graph that was tested.

  • Framework persistence guide
    Active Record Query Interface

    Documents lazy evaluation, eager loading, transactions and query construction that determine the database work behind concise model code.

  • Framework job guide
    Active Job Basics

    Describes queue adapters, enqueueing, retries and job execution concerns that form a separate production path from web requests.

  • Practitioner query question
    Stack Overflow: includes, preload and eager loading

    The discussion shows why Active Record fetch strategy must follow the query and association shape rather than one universal N+1 fix.

  • Community upgrade discussion
    Reddit: upgrading a production Rails application across major versions

    Practitioners describe tests, gem constraints and staged releases during large upgrades. It is anecdotal context for the official upgrade path.

Get started

Tell us what you need

A few quick questions, then a straight answer from a real person — usually within a few hours.

What happens next

  1. 1 We reply A real person reads your answers and gets back to you, usually within a few hours.
  2. 2 Questions or a short call If anything isn't clear, we ask by email or book a short call. Before any call we audit your website and make the quick fixes it finds, free.
  3. 3 Your fixed quote A clear, fixed price in writing, within 48 hours of any call. There is no obligation to go ahead.

Tell us what you're working on

Whether it's a new site, a platform, or a process that shouldn't be manual any more — we'll tell you honestly if we can help.