# Debugging bad gems?

**URL:** <https://www.ruby-forum.com/t/debugging-bad-gems/100966>\
**Category:** Ruby\
**Created:** [August 2, 2006, 4:02am UTC](https://www.ruby-forum.com/t/debugging-bad-gems/100966 "2006-08-02T04:02:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@johnf](https://www.ruby-forum.com/u/johnf)\
**Post date:** [August 2, 2006, 4:02am UTC](https://www.ruby-forum.com/t/debugging-bad-gems/100966/1 "2006-08-02T04:02:10Z")

</div>

Hey folks,

I’ve installed two gems from [http://www.textualize.com](http://www.textualize.com) – sruby (  
[http://www.textualize.com/sruby](http://www.textualize.com/sruby)) and ruby-marc (  
[http://www.textualize.com/ruby\_marc](http://www.textualize.com/ruby_marc)) via gem install from [rubygems.org](http://rubygems.org)  
to my  
ruby 1.8 install on x86 Debian unstable. Both gems installed correctly  
as  
far as I could tell, and I’ve installed many other gems that worked just  
dandy. However, neither of these two gems work. For sruby I get the  
following in irb:

> > require ‘sru’  
> > LoadError: no such file to load – sru  
> > from (irb):1:in `require’  
> > from (irb):1

The marc gem does require correctly, but when it comes time to execute  
the  
sample code listed I get the following error from irb:

```
reader = MARC::Reader.new('batch.dat')

```

NameError: uninitialized constant MARC::Reader  
from (irb):2  
from :0

Any ideas on how to debug this, or should I just badger the folks at  
[textualize.com](http://textualize.com)?

jf

---

<div class="post-metadata">

**Author:** ![johnf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@johnf](https://www.ruby-forum.com/u/johnf)\
**Post date:** [August 2, 2006, 1:23pm UTC](https://www.ruby-forum.com/t/debugging-bad-gems/100966/2 "2006-08-02T13:23:50Z")

</div>

John F. wrote:

> […] However, neither of these two gems work. For sruby I get the  
> following in irb:
> 
> > > require ‘sru’  
> > > LoadError: no such file to load – sru  
> > > from (irb):1:in `require’  
> > > from (irb):1

The fact that there is no reference to RubyGem’s custom\_require in your  
backtrace leads me to suspect that you don’t have RubyGems loaded. Put  
an explicit “require ‘rubygems’” in the code, use the -rubygems switch  
on the command line, or set the RUBYOPT environment variable to  
‘rubygems’.

> The marc gem does require correctly, but when it comes time to execute  
> the  
> sample code listed I get the following error from irb:
> 
> ```
> reader = MARC::Reader.new('batch.dat')
> 
> ```
> 
> NameError: uninitialized constant MARC::Reader  
> from (irb):2  
> from :0

Don’t know about this, but I would double check the RubyGems issue first  
before pursuing other options.

– Jim W.

---

<div class="post-metadata">

**Author:** ![johnf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@johnf](https://www.ruby-forum.com/u/johnf)\
**Post date:** [August 3, 2006, 12:38pm UTC](https://www.ruby-forum.com/t/debugging-bad-gems/100966/3 "2006-08-03T12:38:45Z")

</div>

On 8/2/06, Jim W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The fact that there is no reference to RubyGem’s custom\_require in your
> 
> > ```
> > reader = MARC::Reader.new('batch.dat')
> > 
> > ```
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Did require ‘rubygems’ in irb – now require ‘sru’ returns false instead  
of  
choking like it did earlier. Still doesn’t work though, natch. MARC  
fails  
in the same way. Weirdness.

jf
