Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Cron not installing exec runner by hand throws errors #19

Open
HavocStyles opened this issue Jan 27, 2010 · 8 comments
Open

Cron not installing exec runner by hand throws errors #19

HavocStyles opened this issue Jan 27, 2010 · 8 comments

Comments

@HavocStyles
Copy link

Ubuntu 9.10 server. Everything works great except for reports. Reports not being generated because the crons have not been setup. To try and get the crons installed I did the following

$ gem sources -a http://gems.github.com
$ gem install javan-whenever
$ rake whenever --update-crontab snorby --set environment=production

which produces no output nor adding the crons.

exec $ ./runner -e production "Event.run_daily_report" throws the following errors.

/var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48: /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- prawn/format (MissingSourceFile) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in require' from /root/Snorby/lib/pdf_for_email.rb:3 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:inrequire'
from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in require_or_load' from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:inload_missing_constant'
from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in const_missing' from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:inconst_missing'
from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:in load_missing_constant' from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:inconst_missing'
from /root/Snorby/app/models/event.rb:54:in run_daily_report' from (eval):1 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ineval'
from /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from ./runner:3

Did I miss a step? I'm pretty new to ruby stuff so any help would be great.

Cheers,
Eric

@djcas9
Copy link
Owner

djcas9 commented Jan 27, 2010

Eric,

sudo gem install prawn-format

That should do the trick.

  • Dustin

@HavocStyles
Copy link
Author

Hey Dustin,

 Thanks for the quick reply yesterday! =) Anyway got prawn-format installed

Successfully installed prawn-format-0.2.3
1 gem installed
Installing ri documentation for prawn-format-0.2.3...
Installing RDoc documentation for prawn-format-0.2.3..

When running rake whenever --update-crontab snorby --set environment=production produces no output nor install any crons

Running ./runner -e production "Event.run_daily_report" throws the following

/var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48: /var/lib/gems/1.8/gems/prawn-format-0.2.3/lib/prawn/format.rb:21:in height_of': wrong number of arguments (3 for 2) (ArgumentError) from /var/lib/gems/1.8/gems/prawn-format-0.2.3/lib/prawn/format.rb:21:inheight_of'
from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table/cell.rb:121:in text_area_height' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table/cell.rb:109:inheight'
from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table/cell.rb:243:in <<' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:325:ingenerate_table'
from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:278:in each' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:278:ingenerate_table'
from /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2036:in each_with_index' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:267:ineach'
from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:267:in each_with_index' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:267:ingenerate_table'
from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/font.rb:75:in font_size' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:266:ingenerate_table'
from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:174:in draw' from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document/bounding_box.rb:185:incall'
from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document/bounding_box.rb:185:in init_bounding_box' from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document/bounding_box.rb:155:inbounding_box'
from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:172:in draw' from /var/lib/gems/1.8/gems/prawn-layout-0.7.1/lib/prawn/table.rb:51:intable'
from /root/Snorby/lib/pdf_for_email.rb:77:in make_pdf' from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document.rb:231:ininstance_eval'
from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document.rb:231:in initialize' from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document.rb:128:innew'
from /var/lib/gems/1.8/gems/prawn-core-0.7.1/lib/prawn/document.rb:128:in generate' from /root/Snorby/lib/pdf_for_email.rb:18:inmake_pdf'
from /root/Snorby/app/models/event.rb:54:in run_daily_report' from (eval):1 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ineval'
from /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire'
from ./runner:3

I'll throw up a howto for Ubuntu 9.10 once this gets sorted =)

Cheers,
Eric

@HavocStyles
Copy link
Author

Hey Dustin,

Sorry been busy for a bit, but I did a clean install and the crons are still not being added, and when I click on convert an event to pdf it throws a 500 error

ActionView::TemplateError (undefined method `tags' for #<Prawn::Document:0xb68df584>)  on line #4 of app/views/events/show.pdf.prawn:
1: require 'prawn/layout'
2: require 'prawn/format'
3:
4: pdf.tags :h1 => { :font_size => "2em", :font_weight => :bold },
5: :h2 => { :font_size => "0.5em", :font_weight => :bold },
6: :title => { :font_weight => :bold, :font_size => "1.5em" },
7: :indent => { :width => "2em" },

/var/lib/gems/1.8/gems/prawn-core-0.7.2/lib/prawn/graphics/color.rb:72:in `method_missing'
app/views/events/show.pdf.prawn:4:in `_run_prawn_app47views47events47show46pdf46prawn'
app/controllers/events_controller.rb:16:in `show'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'

Rendering /errors/500.html.erb (500 Internal Server Error)

I think this might be related to "prawn" again I'm very new to ruby.

@djcas9
Copy link
Owner

djcas9 commented Feb 4, 2010

@HavocStyles This is a strange error much like Ticket: 18. What version of prawn do you currently have installed also what distro are you using.

@HavocStyles
Copy link
Author

Hmmm I'll take a look at #18 here is the system info

Ubuntu 9.10 -> 2.6.31-18-generic-pae #55-Ubuntu SMP
Ruby1.8       -> Version: 1.8.7.174-1ubuntu1
*** LOCAL GEMS ***

actionmailer (2.3.5, 2.3.2)
actionpack (2.3.5, 2.3.2)
activerecord (2.3.5, 2.3.2)
activeresource (2.3.5, 2.3.2)
activesupport (2.3.5, 2.3.2)
chronic (0.2.3)
gemcutter (0.3.0)
hoe (2.5.0)
javan-whenever (0.3.7)
json_pure (1.2.0)
mysql (2.8.1)
prawn (0.7.2, 0.7.1)
prawn-core (0.7.2, 0.7.1)
prawn-format (0.2.3)
prawn-layout (0.7.2, 0.7.1)
prawn-security (0.7.1)
rack (1.0.1)
rails (2.3.5, 2.3.2)
rake (0.8.7)
rubyforge (2.0.3)

@HavocStyles
Copy link
Author

Hmmmm found something I think. I did a bit of googling and found a thread which they were talking about prawn environment/initializers, so I went looking for a prawn.rb file in the snorby dir.

find ./ -iname 'prawn*'
./vendor/gems/prawn-0.5.0.1
./vendor/gems/prawn-0.5.0.1/lib/prawn.rb
./vendor/plugins/prawnto
./vendor/plugins/prawnto/tasks/prawnto_tasks.rake
./vendor/plugins/prawnto/lib/prawnto.rb
./vendor/plugins/prawnto/lib/prawnto

So I see the ./vendor/gems/prawn-0.5.0.1 version but as you see above when I do a gem list --local we see prawn (0.7.2, 0.7.1) but from my 500 error we can see snorby trying to use 7.2 version, could be conflicts maybe? Or environment/initializer issue? Hope this helps, let me know if you need anything else.

Cheers,
Eric

@andreshans
Copy link

@flan828
Copy link

flan828 commented Aug 9, 2011

Link is broken.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants