Topic: Not able to require 'memcache' while running unit test

Hi All,

When I run the test case
PROJECT_PATH - test>ruby unit/user_test.rb

I get error environment.rb:6:in `require': no such file to load -- memcache (LoadError)

environment.rb - line no 6

require 'memcache'

In development environment there is no error.

I am new to testing, kindly assist me.

Thanks in advance,

Re: Not able to require 'memcache' while running unit test


I added a line require 'rubygems' above require 'memcache' line. That problem is solved. So can anyone please explain why does require 'rubygems' solve the problem.

when i run
ruby unit/user_test.rb
I have another issue that I am getting an error:
environment.rb:164: uninitialized constant MemCache (NameError)

Even though I have required 'memcache' gem why is that error coming up.