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!

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top