Hey I'm trying to connect my app to redis on a single engineyard instance:
redis-cli ping gets back pong and the server which is included as a gem in the app seems to be running.
When I manually run bundle exec foreman start here is the output:
16:42:24 worker_slow.1 | started with pid 9334
16:42:24 clock.1 | started with pid 9335
16:42:43 clock.1 | I, [2013-09-19T16:42:43.159853 #9335] INFO -- : Starting clock for 1 events: [ run_clockwork ]
16:42:43 clock.1 | I, [2013-09-19T16:42:43.160464 #9335] INFO -- : Triggering 'run_clockwork'
16:42:43 clock.1 | 2013-09-19T16:42:43Z 9335 TID-oswnco03o INFO: Sidekiq client using redis://localhost:6379/0 with options {}
16:42:43 clock.1 | E, [2013-09-19T16:42:43.385730 #9335] ERROR -- : ERR wrong number of arguments for 'set' command (Redis::CommandError)
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis/client.rb:85:in `call'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:675:in `block in set'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:36:in `block in synchronize'
16:42:43 clock.1 | /usr/lib64/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:36:in `synchronize'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bundler/gems/redis-rb-77c2a9965772/lib/redis.rb:673:in `set'
16:42:43 clock.1 | /data/rsscom/releases/20130919162848/app/models/redis_lock.rb:3:in `block in acquire'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/connection_pool-1.1.0/lib/connection_pool.rb:49:in `with'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/sidekiq-2.13.1/lib/sidekiq.rb:67:in `redis'
16:42:43 clock.1 | /data/rsscom/releases/20130919162848/app/models/redis_lock.rb:3:in `acquire'
16:42:43 clock.1 | /data/rsscom/releases/20130919162848/lib/clock.rb:10:in `block in <top (required)>'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/event.rb:51:in `call'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/event.rb:51:in `execute'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/event.rb:46:in `run'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:61:in `block in tick'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:59:in `each'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:59:in `tick'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:49:in `block in run'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:48:in `loop'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork/manager.rb:48:in `run'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/lib/clockwork.rb:26:in `run'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/gems/clockwork-0.6.0/bin/clockwork:19:in `<top (required)>'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bin/clockwork:23:in `load'
16:42:43 clock.1 | /data/rsscom/shared/bundled_gems/ruby/2.0.0/bin/clockwork:23:in `<main>'
I'm not even sure where to begin looking for the set command and why it's receiving the wrong number of arguments. Any have any suggestions?
I dug into this a bit. You can look for the set command issued here:
https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L675
You can put the debugger around here, try to replicate the scenario and get the exact error.
Redis' set command works like:
SET <key_name> <value>
eg:
SET name 'Avi'
For best details:
http://redis.io/commands/set
Was using the gem redis-rb and it extends the SET method but not the last few args. Only name/value.
Related
Running a heroku console with
heroku run console
all commands returning UTF-8 characters (like german Umlauts) will result in the following error:
irb(main):004:0> Play.all[-2]
Play Load (27.5ms) SELECT "plays".* FROM "plays" ORDER BY name asc
Encoding::UndefinedConversionError: U+00E4 from UTF-8 to US-ASCII
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `write'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `printf'
from /usr/local/lib/ruby/1.9.1/irb.rb:311:in `output_value'
from /usr/local/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
from /usr/local/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /usr/local/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /usr/local/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /usr/local/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from /usr/local/lib/ruby/1.9.1/irb.rb:69:in `catch'
from /usr/local/lib/ruby/1.9.1/irb.rb:69:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'Maybe IRB bug!!
I do not really understand the cause of this.
Is there a workaround?
I am using iTerm with a setting of "UTF-8 xterm-color".
Update
This error completely disappeared for no reason known to me and I can reproduce it neither under ruby 1.9.2p320 nor 1.9.3p448
Typing "\u00E4" into the console now yields "ä" as expected:
irb(main):001:0> "\u00E4"
=> "ä"
when i push my app to cloudfoundry
vmc speak to me:
Uploading mywebsite... FAILED
Upload failed. Try again with 'vmc push
TypeError: no implicit conversion of ni
For more information, see ~/.vmc/crash
*then I open ~/.vmc/crash what the content is under*
Time of crash:
2013-03-28 15:39:33 +0800
TypeError: no implicit conversion of nil into String
multipart-post-1.2.0/lib/composite_io.rb:85:in `initialize'
multipart-post-1.2.0/lib/composite_io.rb:85:in `open'
multipart-post-1.2.0/lib/composite_io.rb:85:in `initialize'
cfoundry-0.5.2/lib/cfoundry/v1/base.rb:57:in `new'
cfoundry-0.5.2/lib/cfoundry/v1/base.rb:57:in `upload_app'
cfoundry-0.5.2/lib/cfoundry/upload_helpers.rb:48:in `upload'
vmc-0.5.0/lib/vmc/cli/app/push.rb:86:in `block in upload_app'
interact-0.5.2/lib/interact/progress.rb:98:in `with_progress'
vmc-0.5.0/lib/vmc/cli/app/push.rb:85:in `upload_app'
vmc-0.5.0/lib/vmc/cli/app/push.rb:65:in `setup_new_app'
vmc-0.5.0/lib/vmc/cli/app/push.rb:48:in `push'
mothership-0.5.1/lib/mothership/base.rb:66:in `run'
mothership-0.5.1/lib/mothership/command.rb:72:in `block in invoke'
manifests-vmc-plugin-0.6.2/lib/manifests-vmc-plugin/plugin.rb:142:in `call'
manifests-vmc-plugin-0.6.2/lib/manifests-vmc-plugin/plugin.rb:142:in `block in create_and_save_manifest'
mothership-0.5.1/lib/mothership/callbacks.rb:74:in `with_filters'
manifests-vmc-plugin-0.6.2/lib/manifests-vmc-plugin/plugin.rb:140:in `create_and_save_manifest'
manifests-vmc-plugin-0.6.2/lib/manifests-vmc-plugin/plugin.rb:80:in `wrap_push'
manifests-vmc-plugin-0.6.2/lib/manifests-vmc-plugin/plugin.rb:29:in `block in <class:ManifestsPlugin>'
mothership-0.5.1/lib/mothership/command.rb:82:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:82:in `block (2 levels) in invoke'
mothership-0.5.1/lib/mothership/command.rb:86:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:86:in `invoke'
mothership-0.5.1/lib/mothership/base.rb:55:in `execute'
vmc-0.5.0/lib/vmc/cli.rb:150:in `block (2 levels) in execute'
vmc-0.5.0/lib/vmc/cli.rb:161:in `save_token_if_it_changes'
vmc-0.5.0/lib/vmc/cli.rb:149:in `block in execute'
vmc-0.5.0/lib/vmc/cli.rb:100:in `wrap_errors'
vmc-0.5.0/lib/vmc/cli.rb:145:in `execute'
mothership-0.5.1/lib/mothership.rb:45:in `start'
vmc-0.5.0/bin/vmc:11:in `<top (required)>'
C:/Ruby200-x64/bin/vmc:23:in `load'
C:/Ruby200-x64/bin/vmc:23:in `<main>'
Try to use vmc version 0.4.0, please. I faced a similar issue when using vmc 0.50, and after I changed to vmc 0.4.0, its works fine!
I'm trying to get a rails app to connect to a SQL Express instance. I'm working in a windows environment.
I don't want to setup a DSN so I went with Tindy TDS. Unfortunately, I can't get it to work.
When I execute
rake db:migrate
I see
rake db:migrate
rake aborted!
closed connection
C:/site/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
and when I run the trace, I see
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
closed connection
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-sqlserver-adapter-3.2.10/lib/active_record/connection_adapters/sqlserver_adap
'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specificatio
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specificatio
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/model_schema.rb:308:in `clear_cache!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.11/lib/active_record/railtie.rb:97:in `block (2 levels) in <class:Railtie
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in `_run__107948286__prepare__477
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
C:/rorblog/rorblog/config/environment.rb:5:in `<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:103:in `require_environment!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:187:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:185:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:185:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:165:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
C:/Ruby193/bin/rake:23:in `load'
C:/Ruby193/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate => environment
My database.yml is
development:
adapter: sqlserver
database: MyDatabase
dataserver: localhost\SQLEXPRESS
mode: dblib
username: sa
password: "1234"
In the trace file I see "method missing" but no idea if thats the problem or if it's something else.
Updated my environment.rb file to add error catching
begin
MySite::Application.initialize!
rescue Exception => ex
puts '--------------------'
puts ex.message
puts '--------------------'
end
and I can see that TinyTDS is giving an error
--------------------
Unable to connect: Adaptive Server is unavailable or does not exist
--------------------
So now I have to figure that out.
I am using clockwork gem to send daily emails. I have created clock.rb file inside lib folder.
#clock.rb
require 'rubygems'
require 'clockwork'
include Clockwork
every(1.day, 'reminders.send', :at => '09:30'){
#leave_details = LeaveDetail.all(:conditions => {:status => [LeaveDetail::STATUS_PENDING, LeaveDetail::STATUS_PENDING_MNGT]})
#leave_details.each do |ld|
UserMailer.leave_reminder_email(ld).deliver
end
}
I have created a Procfile:-
web: bundle exec thin start -d
clock: bundle exec clockwork lib/clock.rb
when i command
foreman start
it is showing error:-
17:20:51 web.1 | started with pid 21144
17:20:51 clock.1 | started with pid 21146
17:20:52 clock.1 | I, [2012-12-06T17:20:52.558231 #21150] INFO -- : Starting clock for 1 events: [ reminder.deliver ]
17:20:52 clock.1 | I, [2012-12-06T17:20:52.558324 #21150] INFO -- : Triggering 'reminder.deliver'
17:20:52 clock.1 | E, [2012-12-06T17:20:52.558399 #21150] ERROR -- : uninitialized constant LeaveDetail (NameError)
17:20:52 clock.1 | /home/akhileshwar/Desktop/14-11-2012/RoR/P10HR/lib/clock.rb:8:in `block in <top (required)>'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:93:in `call'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:93:in `run'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:172:in `block in tick'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:170:in `each'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:170:in `tick'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:156:in `block in run'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:155:in `loop'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/lib/clockwork.rb:155:in `run'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/gems/clockwork-0.4.1/bin/clockwork:19:in `<top (required)>'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/bin/clockwork:23:in `load'
17:20:52 clock.1 | /home/akhileshwar/.rvm/gems/ruby-1.9.3-p194#rails326/bin/clockwork:23:in `<main>'
17:20:52 web.1 | >> Deleting stale PID file tmp/pids/thin.pid
17:20:52 web.1 | exited with code 0
17:20:52 system | sending SIGTERM to all processes
SIGTERM received
17:20:52 clock.1 | terminated by SIGTERM
LeaveDetail is a ruby class inside models.
can anyone please tell me why 'LeaveDetail' is showing uninitialized here?. thnks
You're not actually loading your app in clockwork. Clockwork is a separate standalone ruby process. If you don't tell it about the rest of your app, it has no idea of its existence and so your error is logical. This is from sidekiq's clockwork example documentation:
# require boot & environment for a Rails app
require_relative "../config/boot"
require_relative "../config/environment"
You can use include Clockwork as the module, add require './config/boot'
and require './config/environment'
require './config/boot'
require './config/environment'
require 'clockwork'
module Clockwork
every(1.day, 'reminders.send', :at => '09:30'){
#leave_details = LeaveDetail.all(:conditions => {:status => [LeaveDetail::STATUS_PENDING, LeaveDetail::STATUS_PENDING_MNGT]})
#leave_details.each do |ld|
UserMailer.leave_reminder_email(ld).deliver
end
}
end
I cannot use Rails console. Anything that I write there I get the following error.
Any idea?
/Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:773:in `identify_identifier': invalid byte sequence in UTF-8 (ArgumentError)
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:731:in `block in lex_int2'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/slex.rb:236:in `call'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/slex.rb:236:in `match_io'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/slex.rb:75:in `match'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:286:in `token'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:262:in `lex'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:233:in `block (2 levels) in each_top_level_statement'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:70:in `block in start'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `catch'
from /Users/macuser/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `start'
from /Users/macuser/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
from /Users/macuser/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
from /Users/macuser/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'