# Test-unit not found by Ruby but available in gem list

**URL:** <https://www.ruby-forum.com/t/test-unit-not-found-by-ruby-but-available-in-gem-list/217694>\
**Category:** Ruby\
**Created:** [March 8, 2012, 10:26pm UTC](https://www.ruby-forum.com/t/test-unit-not-found-by-ruby-but-available-in-gem-list/217694 "2012-03-08T22:26:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 8, 2012, 10:26pm UTC](https://www.ruby-forum.com/t/test-unit-not-found-by-ruby-but-available-in-gem-list/217694/1 "2012-03-08T22:26:16Z")

</div>

Hi All,

When I include “gem ‘test-unit’” in my ruby file, it gives the following  
error. However my “gem list” does show test-unit. I am not sure what is  
missing when running the file as “ruby ci\_reporter.rb”. The actual ruby  
file is attached.

C:\Ruby\_Scripts\>ruby ci\_report.rb  
C:/Ruby193/lib/ruby/site\_ruby/1.9.1/rubygems/dependency.rb:247:in  
`to_specs': Could not find test-unit (>= 0) amongst [b igdecimal-1.1.0, childprocess-0.3.1, ffi-1.0.11, io-console-0.3, json-1.5.4, minitest-2.5.1, multi_json-1.1.0, rake-0.9. 2.2, rdoc-3.9.4, rubyzip-0.9.6.1, selenium-webdriver-2.20.0, watir-webdriver-0.5.3] (Gem::LoadError) from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in`to\_spec’  
from C:/Ruby193/lib/ruby/site\_ruby/1.9.1/rubygems.rb:1208:in  
`gem' from ci_report.rb:1:in`’

C:\Ruby\_Scripts\>gem list

\*\*\* LOCAL GEMS \*\*\*

builder (3.0.0)  
childprocess (0.3.1)  
ci\_reporter (1.7.0)  
ffi (1.0.11 java)  
jruby-win32ole (0.8.5)  
json (1.6.5 java)  
multi\_json (1.1.0)  
rake (0.8.7)  
rubygems-update (1.8.17)  
rubyzip (0.9.6.1)  
selenium-webdriver (2.20.0)  
sources (0.0.1)  
test-unit (2.4.8)  
watir-webdriver (0.5.3)

---

<div class="post-metadata">

**Author:** ![alexander\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@alexander\_j](https://www.ruby-forum.com/u/alexander_j)\
**Post date:** [March 10, 2012, 6:56am UTC](https://www.ruby-forum.com/t/test-unit-not-found-by-ruby-but-available-in-gem-list/217694/2 "2012-03-10T06:56:39Z")

</div>

Installed the same in another machine, and it worked. Looks like the  
problem is due to installation of jruby. I have no clue of how they are  
related, but the problem is solved for now.

---

<div class="post-metadata">

**Author:** ![alexander\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@alexander\_j](https://www.ruby-forum.com/u/alexander_j)\
**Post date:** [March 10, 2012, 11:23pm UTC](https://www.ruby-forum.com/t/test-unit-not-found-by-ruby-but-available-in-gem-list/217694/3 "2012-03-10T23:23:53Z")

</div>

Some gems are special. Their name is not what you have to require.  
This is usually only the case with gems that contain a `-` in their  
name. Such as ‘test-unit’. When this happens you should consult  
the gem’s documentation. For example, you should require ‘test-unit’  
as ‘test/unit’.
