Problems with 'gem require' and test-unit gem

D

Daniel Berger

Hi all,

C:\>gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
- INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: c:/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: c:/ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mswin32-60
- GEM PATHS:
- c:/ruby/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/

I installed test-unit 2.0.0 as a gem, so now I'm a situation where I
want to explicitly require the gem version of test unit rather than
the one that shipped with the standard library. However, when I try
to do "gem require 'test/unit'" I get this:

C:/Documents and Settings/djberge/workspace/win32-eventlog/test/
tc_mc.rb:10: warning: parenthesize argument(s)
for future version
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:578:in
`report_activate_error': Could not find RubyGem false (>= 0)
(Gem::LoadError)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:134:in
`activate'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'
from C:/Documents and Settings/djberge/workspace/win32-
eventlog/test/tc_mc.rb:10
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
from ./test/ts_all.rb:5
from c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake/
rake_test_loader.rb:5:in `load'
from c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake/
rake_test_loader.rb:5
from c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake/
rake_test_loader.rb:5:in `each'
from c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake/
rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [c:/ruby/bin/ruby -w -Ilib;lib "c:/
ruby/lib...]

Where lines 9 and 10 of tc_mc.rb looks like this:

require 'rubygems'
gem require 'test/unit'

What's the proper way to do this?

Thanks,

Dan
 
E

Eric Hodel

I installed test-unit 2.0.0 as a gem, so now I'm a situation where I
want to explicitly require the gem version of test unit rather than
the one that shipped with the standard library. However, when I try
to do "gem require 'test/unit'" I get this:

[...]

Where lines 9 and 10 of tc_mc.rb looks like this:

require 'rubygems'
gem require 'test/unit'

What's the proper way to do this?


require 'rubygems'
gem 'test-unit'
require 'test/unit'
 
D

Daniel Berger

I installed test-unit 2.0.0 as a gem, so now I'm a situation where I
want to explicitly require the gem version of test unit rather than
the one that shipped with the standard library.  However, when I try
to do "gem require 'test/unit'" I get this:

Where lines 9 and 10 of tc_mc.rb looks like this:
require 'rubygems'
gem require 'test/unit'
What's the proper way to do this?

require 'rubygems'
gem 'test-unit'
require 'test/unit'

Ah, ok.

Many thanks Eric.

Regards,

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top