ZenTest Error in Rails

1.4k views Asked by At

I am following the tutorial on railstutoiral.org and encounter the following error: "ZenTest is not part of the bundle. Add it to Gemfile. (Gem::LoadError)." I have ZenTest (4.4.2) installed according to gemlist so what's wrong? Thanks!

2

There are 2 answers

0
Paul Russell On BEST ANSWER

Open 'Gemfile' in the root of your rails application, and add a section like this to the bottom:

group :development, :test do
  gem 'ZenTest'
end

Then at the command line, type:

bundle install

This command will install the gem and associate it with your application. It might take a few minutes :)

The cause of your problem is that under rails 3, rubygems are managed by a tool called bundler, which manages all the dependencies between your gems and ensures that your application is always started with the right versions of the right gems, even when you move it between servers.

One more thing to note is that if you want to run a command from a gem you've installed using bundler, you need to type 'bundle exec <command>' to ensure the right environment is established to run the command.

0
bobbywilson0 On

Even if you have it installed it isn't getting loaded because it says it isn't in the Gemfile. The Gemfile exists at the root of your project directory.