Closed jalberto closed 7 years ago
Can you try the way sidekiq does it:
require File.expand_path("#{options[:require]}/config/application.rb")
::Rails::Application.initializer "gush.eager_load" do
::Rails.application.config.eager_load = true
end
?
where options[:require]
is the path to your app.
Thanks for the suggestion, but I have same result :(
I also tried several variants requiring environment.rb (to your suggestion and to mine) but somethign weird happens then, The jobs are enqueded (I can see after reload it) but the gush workers are not triggered.
This is really blocking me to use gush.
Something I don't understand is, if gush jobs run inside a sidekiq worker, and sidekiq workers are working well, Why this happens?
Thanks in advance
For the record:
I tried to mimic the way binstubs works, bin/bundle, bin/rake, etc. have slight different ways to work, but none worked for me
And I have same result :(
Rails 4.2.5
This should work with rails >= 4 , adjust those requires accordingly
require './config/application'
::Rails::Application.initializer "gush.eager_load" do
::Rails.application.config.eager_load = true
end
require 'sidekiq/rails' #(well piggybagging on this..)
require './config/environment'
Version 1.0 will have an example on how to load Rails projects correctly :)
Whats the recommended way to run Gush in a Rails (api) project?
I'm trying:
But is not working properly, every job just fail on start because I'm using clasess of my rails proj in the jobs (like Services or Models).
Stack:
Any suggestion?