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

  • SEARCH
  • Home
  • 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 6147271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:04:53+00:00 2026-05-23T19:04:53+00:00

I’m seeing a bug/feature in my Ruby 1.9.2 applications. Any changes to views (not

  • 0

I’m seeing a bug/feature in my Ruby 1.9.2 applications. Any changes to views (not ruby files) require a server restart. I initially encountered this in a Rails app, but I’ve tested the same thing in a minimal Sinatra app too.

I’ll include a simple app to demonstrate

# testapp.rb
require 'sinatra'

get '/' do
  [0,1,2].to_s  #change this to [0,1].to_s
end

This is my procedure:

  • ruby testapp.rb (runs thin server for me)
  • load the page
  • open the file and edit the view
  • reload the page (I see no changes)
  • kill the server
  • restart the server (changes now visible)

I’ve been developing in Ruby 1.8.7 on Rails 3 for the last several months. Having to restart the server on any view change slows down development severely.

I’ve ready this SO thread, but in my version of Rails (3.1.0 rc4), the config variable is already set as per that answer. Additionally I can replicate the error using Sinatra, so that doesn’t seem like it’s the case.

Can anyone shed light on this issue?

Ruby version: ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
Server: thin 1.2.11 (also tested this with Sinatra/Webrick)

EDIT 7/13, Clarification
The Sinatra thing is a separate issue–Sinatra’s source reloading is disabled by default. I used this code to test out the behavior:

require 'sinatra'
require 'sinatra/reloader'
require 'haml'

set :views, 'views'

get '/' do
end

get '/test' do
  haml :test
end

With this, I made a file: views/test.haml. Modifying it while the server is running does show a change when the page is reloaded. Thanks to Tiredpixel for pointing this out

Unresolved Issue: why does Rails 3.1 on Ruby 1.9.2 not reload the views? I’m able to get ruby files to load, but not haml and erb files. I end up restarting the server just to see if a bug was actually fixed (or not fixed) because of a file not loading properly.

EDIT/SOLUTION (copied from my comment in the accepted answer):

The problem was in config/environments/development.rb

config.cache_classes = false

Even after we checked this was correct, we still had the issue. Further down in the file we had:

config.threadsafe!

What this does is set the following 3 flags to true: config.allow_concurrency, config.preload_frameworks, and (surprise!) config.cache_classes.

To fix: move config.threadsafe! above config.cache_classes, so that it doesn’t get implicitly overridden.

  • 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-05-23T19:04:54+00:00Added an answer on May 23, 2026 at 7:04 pm

    Rails is normally configured to automatically reload on every request, whilst in the development environment. This doesn’t happen for files in lib/, though.

    The experience you describe with Sinatra is intended (automatic reloading was removed in 0.9.2): http://www.sinatrarb.com/faq.html#reloading; the Shotgun gem can be installed to perform this reloading.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.