# Gems not working (Windows 184-20)

**URL:** <https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035>\
**Category:** Ruby\
**Created:** [August 15, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035 "2006-08-15T19:21:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [August 15, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035/1 "2006-08-15T19:21:09Z")

</div>

I hate that I don’t understand why this is failing, and have to turn to  
the list for help.

The problem is that rubygems can’t find files that it itself installed.

In an attempt to fix things, I just deleted my entire c:\ruby  
directory, deleted all ruby-related environment variables, and re-ran  
the 184-20 one-click installer. No help.

See the following session:

C:\Documents and Settings\gavin.kistner\>gem -v  
0.9.0

C:\Documents and Settings\gavin.kistner\>gem install usage  
Bulk updating Gem source index for: [http://gems.rubyforge.org](http://gems.rubyforge.org)  
Install required dependency SimpleTrace? [Yn]  
Successfully installed usage-0.0.4  
Successfully installed SimpleTrace-0.0.1

C:\Documents and Settings\gavin.kistner\>gem list Usage

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

usage (0.0.4)  
This module implements a simple no thought command line option  
parser

C:\Documents and Settings\gavin.kistner\>gem env  
Rubygems Environment:

- VERSION: 0.9.0 (0.9.0)
- INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8
- GEM PATH:
  - C:/ruby/lib/ruby/gems/1.8

- REMOTE SOURCES:
  - [http://gems.rubyforge.org](http://gems.rubyforge.org)

C:\Documents and Settings\gavin.kistner\>ruby -e ‘require\_gem “Usage”’  
C:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:251:in  
`report_activate_error': Could not find RubyGem Usage (>= 0.0.0) (Gem: :LoadError) from C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:188:in `activate’  
from C:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:66:in  
`active_gem_with_options' from C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:59:in `require\_gem’  
from -e:1

C:\Documents and Settings\gavin.kistner\>ruby -ve ‘p ENV[“GEM\_HOME”]’  
ruby 1.8.4 (2006-04-14) [i386-mswin32]  
nil

C:\Documents and Settings\gavin.kistner\>set  
GEM\_HOME=c:\ruby\lib\ruby\gems\1.8\gems

C:\Documents and Settings\gavin.kistner\>ruby -e ‘p ENV[“GEM\_HOME”];  
require\_gem “Usage”’  
“c:\ruby\lib\ruby\gems\1.8\gems”  
C:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:251:in  
`report_activate_error': Could not find RubyGem Usage (>= 0.0.0) (Gem: :LoadError) from C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:188:in `activate’  
from C:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:66:in  
`active_gem_with_options' from C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:59:in `require\_gem’

I’ve also tried GEM\_HOME settings of:  
c:\ruby  
c:\ruby\lib  
c:\ruby\lib\ruby  
c:\ruby\lib\ruby\gems  
c:\ruby\lib\ruby\gems\1.8  
c:\ruby\lib\ruby\gems\1.8\gems  
all to no avail.  
(I wish the rubygems documentation would provide examples of the  
various environment variables.)

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [August 15, 2006, 7:30pm UTC](https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035/2 "2006-08-15T19:30:12Z")

</div>

> The problem is that rubygems can’t find files that it itself installed.

Try: require ‘usage’. The windows shell isn’t case sensitive, but ruby  
is.

C:\Documents and Settings\gthiesfeld\desktop\>irb  
irb(main):001:0\> require ‘usage’  
=\> true  
irb(main):002:0\> exit

C:\Documents and Settings\gthiesfeld\desktop\>gem list usage

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

usage (0.0.4)  
This module implements a simple no thought command line option  
parser

C:\Documents and Settings\gthiesfeld\desktop\>gem list Usage

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

usage (0.0.4)  
This module implements a simple no thought command line option  
parser

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [August 15, 2006, 7:42pm UTC](https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035/3 "2006-08-15T19:42:13Z")

</div>

Hrm, mine doesn’t work quite like yours, but I got it to work.  
Crazy-cased gem. Thanks.

To hijack my own thread: Why doesn’t require work the same as  
require\_gem? Both find the Usage.rb file and load it, but using require  
causes it not to properly run the "require\_gem “SimpleTrace”, “\<=  
0.1.0” command inside Usage.rb, resulting in the error shown in the  
first block below:

===

# Thought it should work, given my RUBYOPT setting; but it doesn’t.

# Case doesn’t matter here, on Windows.

===  
require ‘Usage’ # or require ‘usage’; same effect

p Usage  
#=\> Usage

p Usage.new( “foo” )  
C:/ruby/lib/ruby/gems/1.8/gems/usage-0.0.4/lib/Usage.rb:605:in  
`initialize': undefined method`debug’ for nil:NilClass (NoMethodError)  
from C:/ruby/lib/ruby/gems/1.8/gems/usage-0.0.4/lib/Usage.rb:977:in  
`initialize’  
from tmp.rb:2

===

# Oops, bad case also caused me confusion.

===

require\_gem ‘Usage’  
C:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:251:in  
`report_activate_error': Could not find RubyGem Usage (>= 0.0.0) (Gem::LoadError) from C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:188:in`activate’  
from C:/ruby/lib/ruby/site\_ruby/1.8/rubygems.rb:66:in  
`active_gem_with_options' from C:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:59:in`require\_gem’  
from tmp.rb:1

===

# Yay, the ‘magic’ combination that works!

===

require\_gem ‘usage’

p Usage  
#=\> Usage

p Usage.new( “foo” )  
#=\> PROGRAM: tmp.rb  
#=\> ERROR: too few arguments 1 expected, 0 given  
#=\>  
#=\> USAGE: tmp.rb foo

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [August 15, 2006, 7:42pm UTC](https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035/4 "2006-08-15T19:42:13Z")

</div>

Umm, I was wrong. Disregard my last email. I’ll try to think before I  
reply from now on.

irb(main):001:0\> require ‘Usage’  
=\> true

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [August 17, 2006, 1:52am UTC](https://www.ruby-forum.com/t/gems-not-working-windows-184-20/65035/5 "2006-08-17T01:52:19Z")

</div>

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

> Hrm, mine doesn’t work quite like yours, but I got it to work.  
> Crazy-cased gem. Thanks.
> 
> To hijack my own thread: Why doesn’t require work the same as  
> require\_gem? Both find the Usage.rb file and load it, but using require  
> causes it not to properly run the "require\_gem “SimpleTrace”, “\<=  
> 0.1.0” command inside Usage.rb, resulting in the error shown in the  
> first block below:

See  
[http://redhanded.hobix.com/inspect/autorequireIsBasicallyGoneEveryone.html](http://redhanded.hobix.com/inspect/autorequireIsBasicallyGoneEveryone.html)  
This might help explain how require\_gem works
