# Uninitialized constant Ruport::Report (NameError)

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-ruport-report-nameerror/166094>\
**Category:** Ruby\
**Created:** [April 21, 2009, 8:38pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-ruport-report-nameerror/166094 "2009-04-21T20:38:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 21, 2009, 8:38pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-ruport-report-nameerror/166094/1 "2009-04-21T20:38:06Z")

</div>

I got this code off the website below. I wanted to run and watch the  
example then create code with the ruport gem. On the website, the user  
never got an answer on why he is getting the error “uninitialized  
constant Ruport::Report (NameError)”. I would like for this to work for  
me but when I tried to check it out by running it after installing the  
ruport gem, I also got that error. Does anyone know how to fix this? I  
do get this error now and then but have never understood why it happens.  
Thanks  
MC

[http://www.phwinfo.com/forum/comp-lang-ruby/356308-send-email-ruby.html](http://www.phwinfo.com/forum/comp-lang-ruby/356308-send-email-ruby.html)

#! /usr/bin/ruby

require ‘ruport’

r = Ruport::Report.new  
r.add\_mailer :default,  
:host =\> “my.smtp.host”,  
:address =\> “my@adress”

r.send\_to(‘send.to@mail’) do |mail|  
mail.subject = “Subject”  
Dir[“\*.tif”].each { | cName | mail.attach(cName) }  
mail.text = “Body text”  
end

---

<div class="post-metadata">

**Author:** ![mmcolli00](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mmcolli00](https://www.ruby-forum.com/u/mmcolli00)\
**Post date:** [April 21, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-ruport-report-nameerror/166094/2 "2009-04-21T21:00:34Z")

</div>

Nevermind this - I see a thread just like this one. Sorry guys.
