Hi,
I've been having problems getting some things to run in rails that run fine standalone. There's this cool ruby reporting framework called ruport, which I have running from within rails, but when I try and add support for more complex things (like graphs) that require their extension ruport- util things fail in rails with no error reported, but still work fine from within irb. I have the appropriate gems installed:
ruport (1.4.0) A generalized Ruby report generation and templating engine.
ruport-util (0.13.0) A set of tools and helper libs for Ruby Reports
and as I said I can manipulate graphs from the irb prompt:
irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'ruport' => true irb(main):004:0> require 'ruport/util' => true irb(main):006:0> g = Graph(table.column('date')) => #<Ruport::Data::Graph:0x14a54b0 @record_class="Ruport::Data::GraphData", @column_names=["01 December 2007",
however when I try to so the same within a rails application (currently fired from script/runner), I get failures with no errors when I try to include "require ''ruport/util" in my rails code.
I have required ruport fine, but inclusion of the a ruport/util require leaves script/runner giving me this output:
samuel-josephs-computer:~/Code/myproject samueljoseph$ ruby script/ runner Statistics.ruport > test.pdf
Run 'script/runner -h' for help.
there are no errors in the development log, and if I remove the ruport/ util require statement I get an error about use of the graph object:
samuel-josephs-computer:~/Code/myproject samueljoseph$ ruby script/ runner Statistics.ruport > test.pdf /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/runner.rb: 47: undefined method `Graph' for #<DailyStatsRenderer:0x4bd53e0> (NoMethodError)
suggesting to me that rails is having trouble requiring ruport/util, because this error indicates that everything else is working except for access to ruport/utils
is there something special I have to do to access error information from rails when importing third party libraries?
I've tried putting the require of ruport-util in all sorts of other places in the code, but no joy.
Any help will be greatly appreciated.
Many thanks in advance