0

I have a separate script in my Rails app which is executed like a worker by Bunny (an AMQP client), I don't need to load the entire app. For instance I certainly won't need anything like Unicorn or any of the the routes, etc. I basically only need access to my models. Is this possible?

Right now the worker loads the entire rails app like this:

require ::File.expand_path('../config/environment', __FILE__)
JP Silvashy
  • 46,977
  • 48
  • 149
  • 227
  • 2
    Possible duplicate of [Load only part of environment for rake task?](http://stackoverflow.com/questions/9779025/load-only-part-of-environment-for-rake-task) – Brad Werth Oct 28 '15 at 06:20
  • Or maybe http://stackoverflow.com/questions/1757689/load-ruby-on-rails-models-without-loading-the-entire-framework, but it doesn't have as actionable an answer. The first one seems likely to work... – Brad Werth Oct 28 '15 at 06:21

0 Answers0