作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 delay_job 来做一些后台任务。在这两者之间,我想跟踪一些事件。我正在使用 mixpanel gem跟踪事件。在 Controller 中它工作得很好。但不是在延迟工作中。
我正在使用的代码
@original_message = Message.find(message_id)
@mixpanel= Mixpanel::Tracker.new("43242637426346287482", message_id, true)
@mixpanel.track_event("blank_body", {:reset_result => "sucess" })
//message_id is a unique for every request.
gem 'mixpanel' in gemfile
{undefined method `[]=' for 45:Fixnum
clear_queue'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/mixpanel-0.9.0/lib/mixpanel/tracker.rb:13:in
初始化'\n/Users/mohit/projects/textadda/lib/message_job.rb:109:in
new'\n/Users/mohit/projects/textadda/lib/message_job.rb:109:in
执行'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/backend/base.rb:87:in
invoke_job'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in
运行'\n/Users/mohit/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/timeout.rb:67:in
timeout'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:120:in
运行'\n/Users/mohit/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/benchmark.rb:308:in
realtime'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:119:in
运行'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:177:in
reserve_and_run_one_job'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:104:in
work_off'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in
times'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:103:in
work_off'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:78:in
start'\n/Users/mohit/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/benchmark.rb:308:in
实时'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:77:in
start'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:in
循环'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/worker.rb:74:in
start'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/delayed_job-2.1.4/lib/delayed/tasks.rb:9\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:205:in
调用'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:205:in
execute'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:200:in
每个'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:200:in
execute'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:158:in
invoke_with_call_chain'\n/Users/mohit/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/monitor.rb:242:in
synchronize'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:151:in
invoke_with_call_chain'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/task.rb:144:in
invoke'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:112:in
invoke_task'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:90:in
top_level'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:90:in
每个'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:90:in
top_level'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:129:in
standard_exception_handling'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:84:in
top_level'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:62:in
运行'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:129:in
standard_exception_handling'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/lib/rake/application.rb:59:in
运行'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.9.2/bin/rake:32\n/Users/mohit/.rvm/gems/ruby-1.8 .7-p334/bin/rake:19:in `load'\n/Users/mohit/.rvm/gems/ruby-1.8.7-p334/bin/rake:19
最佳答案
你应该做这样的事情:
@mixpanel= Mixpanel::Tracker.new("43242637426346287482", {:REMOTE_ADDR => message_id}, true)
@mixpanel.track_event("blank_body", {:reset_result => "sucess" })
@mixpanel= Mixpanel::Tracker.new("43242637426346287482", {}, true)
@mixpanel.track_event("blank_body", {:reset_result => "sucess" })
关于ruby-on-rails - 无法在延迟工作中点击混合面板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6899706/
我需要你的帮助!我在它们之间放置了随机数量的 div。 Item description Item description Item description Item
我有两个 NSDates,时间格式为“h:mm a”(即 6:00 AM 和 8:00 PM)。 我试图找出这两个时间之间的中点是什么时间。 对于上面的示例,早上 6:00 和晚上 8:00 之间的中
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 8 年前。 Improve th
我正在寻找一种有效的算法来检查一个点是否在 3D 中的另一个点附近。 sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2) < radius 这似乎并不太快,实际上我不需要这
我可以让 pandas cut/qcut 函数返回 bin 端点或 bin 中点而不是一串 bin 标签吗? 目前 pd.cut(pd.Series(np.arange(11)), bins = 5)
我是一名优秀的程序员,十分优秀!