Reputation: 6897
I am trying to replicate the Advanced testing setup from Michael Hartl's Rails Tutorial, which uses guard-minitest
.
Here is my Gemfile
:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.10'
gem 'byebug', '6.0.2'
gem 'web-console', '2.2.1'
gem 'spring', '1.3.6'
end
group :test do
gem 'minitest-reporters', '1.0.20'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.4.4'
end
group :production do
gem 'pg', '0.18.2'
gem 'rails_12factor', '0.0.3'
end
And here is what I get when I run bundle install --without production
:
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.....
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.2
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using loofah 2.0.3
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.2
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.2
Using globalid 0.3.6
Using activejob 4.2.2
Using mime-types 2.6.1
Using mail 2.6.3
Using actionmailer 4.2.2
Using activemodel 4.2.2
Using arel 6.0.3
Using activerecord 4.2.2
Using ansi 1.5.0
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using bundler 1.10.4
Using byebug 6.0.2
Using coffee-script-source 1.9.1.1
Using execjs 2.6.0
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.2
Using coffee-rails 4.1.0
Using guard-compat 1.2.1
Using guard-minitest 2.4.4
Using multi_json 1.11.2
Using jbuilder 2.3.1
Using jquery-rails 4.0.4
Using sprockets 3.3.3
Using sprockets-rails 2.3.2
Using rails 4.2.2
Using mini_backtrace 0.1.3
Using ruby-progressbar 1.7.5
Using minitest-reporters 1.0.20
Using rdoc 4.2.0
Using sass 3.4.18
Using tilt 1.4.1
Using sass-rails 5.0.3
Using sdoc 0.4.1
Using spring 1.3.6
Using sqlite3 1.3.10
Using turbolinks 2.5.3
Using uglifier 2.7.1
Using web-console 2.2.1
Bundle updated!
Gems in the group production were not installed.
So, it seems I do have guard-minitest 2.4.4
installed.
However, when I run bundle exec guard init
, I get the following error:
/Users/XXX/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.10.4/lib/bundler/rubygems_integration.rb:292:in `block in replace_gem': guard is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
from /Users/XXX/.rvm/gems/ruby-2.2.1/bin/guard:22:in `<main>'
from /Users/XXX/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
from /Users/XXX/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Any idea of what I am doing wrong?
Upvotes: 1
Views: 1734
Reputation: 6897
As specified in the install section of the guard-minitest
README, with newer versions of the gem, guard
is also required.
I just updated my Gemfile as follows:
[...]
group :test do
gem 'minitest-reporters', '1.0.20'
gem 'mini_backtrace', '0.1.3'
gem 'guard'
gem 'guard-minitest', '2.4.4'
end
[...]
and now everything is working just fine.
Upvotes: 3