0
votes

I am following the "Intro to rails Screencast - the tutorial I wish I had" from http://net.tutsplus.com/tutorials/ruby/the-intro-to-rails-screencast-i-wish-i-had/?search_index=2

Based on that I added the following gems to my file -

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

I than ran the following commands -

rails g rspec:install
guard init rspec
guard

I get the following error on running guard. I should be instead seeing the failed tests. I have already generated an integration test -

Guard here! It looks like your project has a Gemfile, yet you are running guard outside of Bundler. If this is your intent, feel free to ignore this message. Otherwise, consider using bundle exec guard to ensure your dependencies are loaded correctly. (You can run guard with --no-bundler-warning to get rid of this message.)

Guard uses Libnotify to send notifications. Guard is now watching at '/home/murtaza/workspace/rails/tasks' Guard::RSpec is running, with RSpec 2! Running all specs gem install minitest /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/test/unit/testcase.rb:9:in <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 ' from /home/murtaza/.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 ' from /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 ' from /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 ' from /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 require' from /home/murtaza/workspace/rails/tasks/spec/requests/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:inload' from /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' from /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' >

2

2 Answers

1
votes

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

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

1
votes

Try running bundle exec guard as your final command instead of running guard.

The bundle exec portion of the command tells guard to run within the gems that were loaded via Bundler. Bundler is a tool that allows your local folder to have it's own gem environment.

That's what the error message indicates:

Guard here! It looks like your project has a Gemfile, yet you are running guard outside of Bundler. If this is your intent, feel free to ignore this message. Otherwise, consider using bundle exec guard to ensure your dependencies are loaded correctly. (You can run guard with --no-bundler-warning to get rid of this message.)