Spork seems to have the same problem that I have with spec_server:
end
Sweet! Seems to be working great now.
Looks like the README has changed over the weekend - previously, I had
been starting the spec server with script/spec_server. Running spork
directly seems to work just fine.
Thanks a TON!
Scott
Ok cool. Seems like the bug may of been poor documentation… please
send a pull request if you think it can be improved.
Ben J.,
Have you given up on this? You’re right - that defeats the purpose of
Spork. You need to make sure that any code that loads code in your
project
does not make it in to your Spork.prefork block. If you are
specifically
loading the models in your environment, that’s your problem.
Here’s some possible options to resolve what you’re experiencing:
Add spork blocks to your environment.rb to put portions that are
loading
code you develop on inside of a Spork.each_run block, and the rest of it
in
a Spork.prefork block.
modify your environment.rb file to only load libraries like gems and
plug-ins, and set up autoload to load the rest of your classes as you
need
them. Alternatively, is this is a matter of pre-caching, you could
choose
not to load those classes preemptively in the test environment.
Did anyone ever figure out the factory_girl / machinist issues? I am
having the same problems and can figure out how to fix it for the life
of me. The first run works fine, then afterwards I get a bunch of these
errors:
Some plugins (like Thinking Sphinx) preload all the files in the app/
folder. You can see if this is the case by logging spork’s output to a
file and see what requested the app/* files to load.
Hope it helps someone! It took me an hour to solve this
Zach Powell wrote:
Ben J. wrote:
Did anyone ever figure out the factory_girl / machinist issues? I am
having the same problems and can figure out how to fix it for the life
of me. The first run works fine, then afterwards I get a bunch of these
errors: