# Third party library that runs standalone but not in rails

**URL:** <https://www.ruby-forum.com/t/third-party-library-that-runs-standalone-but-not-in-rails/131868>\
**Category:** Rails\
**Created:** [March 14, 2008, 12:03am UTC](https://www.ruby-forum.com/t/third-party-library-that-runs-standalone-but-not-in-rails/131868 "2008-03-14T00:03:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tansaku](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ebca7d/32.png) [@tansaku](https://www.ruby-forum.com/u/tansaku)\
**Post date:** [March 14, 2008, 12:03am UTC](https://www.ruby-forum.com/t/third-party-library-that-runs-standalone-but-not-in-rails/131868/1 "2008-03-14T00:03:19Z")

</div>

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  
CHEERS\> SAM

---

<div class="post-metadata">

**Author:** ![tansaku](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ebca7d/32.png) [@tansaku](https://www.ruby-forum.com/u/tansaku)\
**Post date:** [March 14, 2008, 10:10am UTC](https://www.ruby-forum.com/t/third-party-library-that-runs-standalone-but-not-in-rails/131868/2 "2008-03-14T10:10:11Z")

</div>

On 13 Mar 2008, at 23:02, tansaku wrote:

> irb(main):002:0\> require ‘ruport’  
> when I try to include “require ''ruport/util” in my rails code.  
> 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)

Well suggestion number one is to use the debugger to start poking  
around. Suggestion 2 is to write Ruport::Data::Graph instead of Graph.

Fred
