0

我正在关注来自http://net.tutsplus.com/tutorials/ruby/the-intro-to-rails-screencast-i-wish-i-had/的“Rails Screencast 简介 - 我希望拥有的教程” ?search_index=2

基于此,我将以下宝石添加到我的文件中 -

group :test, :development do 
  gem 'turn'
  gem 'rspec-rails'
  gem 'capybara'
  gem 'guard-rspec'
  gem 'libnotify'
end

我比运行以下命令 -

rails g rspec:install
guard init rspec
guard

我在运行警卫时收到以下错误。相反,我应该看到失败的测试。我已经生成了一个集成测试 -

守在这里!看起来您的项目有一个 Gemfile,但您在guardBundler 之外运行。如果这是您的意图,请随时忽略此消息。否则,请考虑使用bundle exec guard 以确保正确加载您的依赖项。(您可以guard 使用 --no-bundler-warning 运行以消除此消息。)

Guard 使用 Libnotify 发送通知。Guard 现在在 '/home/murtaza/workspace/rails/tasks' 观看 Guard::RSpec 正在运行,使用 RSpec 2!<class:TestCase>': uninitialized constant Test::Unit::TestCase::Assertions (NameError) from /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit/testcase.rb:8:in 从 /home/murtaza/运行所有规格 gem install minitest /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit/testcase.rb:9:in ' .rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit/testcase.rb:4:in <module:Test>' from /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit/testcase.rb:3:in '来自/home/murtaza/.rvm/rubies/ruby-1.9.3- p194/lib/ruby/1.9.1/test/unit.rb:5:in <top (required)>' from /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit/assertions.rb:4:in '来自 /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-rails-2.11.0/lib /rspec/rails/adapters.rb:2:in <top (required)>' from /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-rails-2.11.0/lib/rspec/rails.rb:10:in '来自 /home/murtaza/workspace/rails/tasks/spec/spec_helper.rb:4:in<top (required)>' from /home/murtaza/workspace/rails/tasks/spec/requests/tasks_spec.rb:1:in 要求'来自 /home/murtaza/workspace/rails/tasks/spec/请求/tasks_spec.rb:1:in <top (required)>' from /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in从/home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in block in load_spec_files' from /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:inmap'从/home/加载' murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in load_spec_files' from /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:inrun' from /home/murtaza/.rvm/gems /ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in run' from /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in block in autorun' >

4

2 回答 2

1

The issue is with the 'turn' gem. Removing it does the trick.

https://github.com/rspec/rspec-rails/issues/484

于 2012-07-30T05:26:47.727 回答
1

尝试运行bundle exec guard作为您的最终命令,而不是运行guard.

bundle exec命令的一部分告诉守卫在通过加载的 gem 中运行Bundler。Bundler 是一个工具,它允许您的本地文件夹拥有自己的 gem 环境。

这就是错误消息所指示的内容:

守在这里!看起来您的项目有一个 Gemfile,但您在 Bundler 之外运行守卫。如果这是您的意图,请随时忽略此消息。否则,请考虑使用 bundle exec guard 来确保正确加载您的依赖项。(您可以使用 --no-bundler-warning 运行警卫以消除此消息。)

于 2012-12-26T21:41:02.120 回答