lundi 13 octobre 2014

Whenever gem NoMethodError


Vote count:

0




I am trying to make a functionality that sends emails at a specific time every day. I am using the whenever gem with rails 4 but I am can t get it work.



shedule.rb
every 4.days do
runner "User.reporting"
end

User.rb
def self.reporting
users_size = 1
ReportsMailer.reporting_users(users_size).deliver
end


After running the "whenever --update-crontab" the command "whenever" in terminal shows:



0 0 1,5,9,13,17,21,25,29 * * /bin/bash -l -c 'cd /var/homes/HS && bin/rails runner -e production '\''User.reporting'\'''

## [message] Above is your schedule file converted to cron syntax; your crontab file was not updated.
## [message] Run `whenever --help' for more options.
You have new mail in /var/spool/mail/root


When I am running form my terminal:



/bin/bash -l -c 'cd /var/homes/HS && bin/rails runner -e production '\''User.reporting'\'''


I get:



/usr/local/rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.0/lib/rails/commands/runner.rb:53:in `eval': undefined method `reporting' for #<Class:0xc0028bc> (NoMethodError)


After this the not only the mail is not sending but my facebook_omniauth gives me an error:



NoMethodError (private method `user_count_signin' called for #<User:0xc1549b8>):


app/controllers/access_controller.rb:58:in `facebook_connect'


This is in a production environment.



asked 34 secs ago







Whenever gem NoMethodError

Aucun commentaire:

Enregistrer un commentaire