stpl / systango_hrm

Redmine plugin that allows for leave management of users.
7 stars 4 forks source link

Can't execute "nohup rake jobs:work &" #5

Closed mrPsycho closed 10 years ago

mrPsycho commented 10 years ago

Hello!

i tried to check new version, and now in nohup.out i see this:

rake aborted! database configuration does not specify adapter /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in resolve_hash_connection' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:inresolve_string_connection' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in spec' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-3.2.19/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:inestablish_connection' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-3.2.19/lib/active_record/railtie.rb:88:in block (2 levels) in <class:Railtie>' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/lazy_load_hooks.rb:36:ininstance_eval' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/lazy_load_hooks.rb:36:in execute_hook' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/lazy_load_hooks.rb:26:inblock in on_load' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/lazy_load_hooks.rb:25:in each' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/lazy_load_hooks.rb:25:inon_load' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-3.2.19/lib/active_record/railtie.rb:80:in block in <class:Railtie>' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/initializable.rb:30:ininstance_exec' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/initializable.rb:30:in run' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/initializable.rb:55:inblock in run_initializers' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/initializable.rb:54:in each' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/initializable.rb:54:inrun_initializers' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/application.rb:136:in initialize!' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/railtie/configurable.rb:30:inmethod_missing' /home/redmine/redmine/config/environment.rb:14:in <top (required)>' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:inrequire' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in block in require' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:236:inload_dependency' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in require' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/application.rb:103:inrequire_environment!' /home/redmine/.rvm/gems/ruby-2.0.0-p451/gems/railties-3.2.19/lib/rails/application.rb:305:in block (2 levels) in initialize_tasks' /home/redmine/.rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:ineval' /home/redmine/.rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `

' Tasks: TOP => jobs:work => jobs:environment_options => environment (See full trace by running task with --trace)

all migrations done successfully.

stpl commented 10 years ago

This issue is probably occurring due to incorrect database configuration. Can you provide us the command which you are using to start server and to execute migrations so that we can identify the environment.

mrPsycho commented 10 years ago

i did it like you wrote on README:

  1. Copy systango_hrm plugin to {RAILS_APP}/plugins on your redmine path
  2. Run bundle install –without development test RAILS_ENV=production
  3. Run rake redmine:plugins NAME=systango_hrm RAILS_ENV=production all steps above are gone correct and without errors

4.Run nohup rake jobs:work & fails

  1. Run rake task for 'send reminder email for pending leaves' and 'recalculate leaves on holiday calender update' didn't do it. any way, what do you mean by rake task "send reminder email for pending leaves"? what is the command for this?
stpl commented 10 years ago

You need to execute "rake jobs:work" under production environment like "nohup rake jobs:work RAILS_ENV=production &".

Regarding rake, "Rake is Ruby Make, a standalone Ruby utility that replaces the Unix utility 'make'". For detailed description of rake task you can refer :- http://stackoverflow.com/questions/18737696/what-is-rake-and-how-it-is-used-in-rails.

To execute rake task you can use this command:-

For sending reminder emails for pending leaves:- "rake systango_hrm:send_reminder_email_for_pending_leaves RAILS_ENV=production" For recalculating leaves:- "rake systango_hrm:recalculate_leaves_on_holiday_calender_update RAILS_ENV=production"

Also we have updated README file for the same.

mrPsycho commented 10 years ago

Great! Thanks!