-1

I've experienced a strange bug with rails 3.2 / git.

In development mode, classes was not reloaded between requests (controllers, models, helpers) but views work.

I've searched a long time in unmodified configuration (application.rb, development.rb...) without success, I have to reload Thin to show changes.

So I've decided to create a new branch and revert commit by commit (I was thinking a bad updated/integration gem) and the code reload properly to the last commit !

Back to the master branch, code is reloaded properly between requests without any code change.

I'm running on Archlinux, ruby 1.9.3p194 (rvm), postgresql 9.1.4, git 1.7.11.1, ext4 FS tuned (UUID=ac74249f-84de-40d0-8b14-eb494983cfda /home ext4 defaults,noatime,data=writeback,barrier=0,nobh,errors=remount-ro 0 1)

What do you think about that ?


This bug never came back and very difficult to reproduce. I can't accept uncertain answers.

Shog9
  • 156,901
  • 35
  • 231
  • 235
m4tm4t
  • 2,361
  • 1
  • 21
  • 37
  • 2
    I don't know enough rails to debug your problem, but "revert commit by commit" makes me sad. [Look up](http://git-scm.com/book/en/Git-Tools-Debugging-with-Git) `git bisect`. [It'll change your life.](http://git-scm.com/book/en/Git-Tools-Debugging-with-Git) – Christopher Jul 11 '12 at 15:07

2 Answers2

2

I think your problem has nothing to do with GIT, only rails.

Try to put in your config/environments/development.rb:

  config.cache_classes = false

That's rails configuration which tells it to reload classes (such as models or controllers) between requests.

Just to be sure, run rails server with: RAILS_ENV=development rails s

Erez Rabih
  • 15,562
  • 3
  • 47
  • 64
  • I'm sure at 100% this is not a rails issue because environment configuration was untouched and the problem disappears after creating a new git branch. And during the issue, the environment was well in development – m4tm4t Jul 11 '12 at 16:01
0

Perhaps the problem is the noatime option in the fstab. How should rails now that the file has changed if the timestamp is not touched. You could try to remove the option.

Mark
  • 7,507
  • 12
  • 52
  • 88