Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8621659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:52:05+00:00 2026-06-12T06:52:05+00:00

It seems like a common problem in Ruby applications in typical long-running process environments

  • 0

It seems like a common problem in Ruby applications in typical long-running process environments such as the rails server, that class-reloading to ease development pain is a difficult, but important problem to solve.

It strikes me that the language knows best what constants are defined by the stdlib, and is perfectly placed to know what constants were loaded from what files and when, and of course to offer to re-load them.

There are come complex cases where by require 'foo', you also define Bar, but that isn’t too challenging to track, and furthermore cases where define_const has been used also muddy things up. Threaded loading is yet another problem, but I can really see a case for allowing threads to re-load themselves from the current state of the disk’s files. (Faster test server would be #1 thought)

It seems like it should be a language feature, and not something that many, many different people need to roll solutions for.

So in summary, why is it that this isn’t a language feature? It seems like it should be, although the usage profile is almost exclusively limited to long running dev servers.

The other question here could be “why doesn’t Rails use a built-in DRB model for making the dev server fast, and skip all the class reloading”, that’s also an interesting discussion, but not for now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:52:06+00:00Added an answer on June 12, 2026 at 6:52 am

    To be able to automatically re-load a class you’ll need to know how that class came to be constructed. Given how dynamic Ruby is, this is only easy in the most trivial of cases. It is common enough to have a class that’s extended and altered significantly before it ends up in its final form. Determining the steps involved to recreate a class is not easy, and tracking these could be a severe performance drag.

    A lot of this boils down to the fact that a Class is a collection of methods, instance variables, class variables, constants, and other modules and classes. Unlike more statically typed languages like C++, these can and will be declared at any time, in any place, for any reason. The state of the class is not something that can simply be re-generated.

    The way Rails goes about reloading classes is to perform a number of tricks to ensure the class in question can be disposed of and reloaded. Rails also has to provide several hooks to notify extensions that a class is being reloaded so they can re-do their operations on it once it’s been rebuilt otherwise many extensions would load only once.

    In short, what seems superficially trivial turns out to be very tricky indeed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have what seems like a common problem / pattern. two collections of the
So I've got what seems to be a common problem, which is that the
This seems like it would be a common problem, but I just can't seem
It seems like this is a common problem, but I can't seem to find
This seems like a pretty common problem, but I haven't found any sort of
This seems to be a fairly common problem, but the solutions that I have
This seems like a common problem, but I'm unable find an adequate solution. I'm
This seems like a very simple and a very common problem. The simplest example
This seems like it should be a common problem but I'm having trouble finding
This seems like it would be a common issue to be but I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.