1

I already removed all environment variables and ruby/ironruby directories and reinstalled it from scratch. And then I installed mocha through igem. Here are my outputs.

$ ir
IronRuby 0.9.1.0 on .NET 2.0.50727.3082
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'mocha'
:0:in `require': no such file to load -- mocha (LoadError)
        from :0

Listing my installed gems. . .

$ igem list --local

*** LOCAL GEMS ***

mocha (0.9.8)
rake (0.8.7)

This is my gem environment.

$ igem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.6 (2008-05-28 patchlevel 0) [i386-mswin32]
  - INSTALLATION DIRECTORY: C:/ironruby/lib/IronRuby/../..//lib/ironruby/gems/1.8
  - RUBY EXECUTABLE: C:/ironruby/lib/IronRuby/../..//bin/ir.exe
  - EXECUTABLE DIRECTORY: C:/ironruby/lib/IronRuby/../..//bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mswin32-60
  - GEM PATHS:
     - C:/ironruby/lib/IronRuby/../..//lib/ironruby/gems/1.8
     - C:/Documents and Settings/vitalim/.gem/ironruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com

Hope you can hep me with this :(

Vega
  • 27,856
  • 27
  • 95
  • 103
Marc Vitalis
  • 2,129
  • 4
  • 24
  • 36
  • I don't have IR to hand here at work, but it may support the -r flag and the RUBYOPT environment variable. For MRI 1.8.6, I have (autocreated at install time) "RUBYOPT=-rubygems", where -r indicates a required library and "ubygems" points to "rubygems". Then again, it may not... ;-) – Mike Woodhouse Oct 01 '09 at 08:42

1 Answers1

6

require 'rubygems' then require 'mocha' should work in this case. Require'ing rubygems sets up require to be able to find your gems.

Jim Deville
  • 10,632
  • 1
  • 37
  • 47