Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8163619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:06:17+00:00 2026-06-06T19:06:17+00:00

Michael Hartl’s wonderful Rails Tutorial is now available for Rails 3.2. He continues to

  • 0

Michael Hartl’s wonderful Rails Tutorial is now available for Rails 3.2. He continues to outline TDD and BDD using rspec and spork as he did in version 3.0 and adds guard in 3.2. In version 3.0, Hartl includes information about autotest and I was able to get the wonderful growl notifications working. In 3.2, however, he no longer includes autotest or much growl information. Guard is working nicely with spork but there’s no notifications. I’ve ventured out on my own the last couple hours using Hartl’s 3.0 and some blog posts but trying to get autotest to work still produces a “LoadError” and a growl notification “could not run tests.” Super grateful for any thoughts. I’m on OS X 10.7.3. Here’s what I did:

$ gem install autotest -v 4.4.6
$ gem install autotest-rails-pure -v 4.1.2
$ gem install autotest-fsevent -v 0.2.8
$ gem install autotest-growl -v 0.2.16

Gemfile

source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'pg', '0.12.2'
group :development, :test do 
    gem 'rspec-rails', '2.9.0'
    gem 'guard-rspec', '0.5.5'
end

group :assets do
    gem 'sass-rails','3.2.4' 
    gem 'coffee-rails', '3.2.2'
    gem 'uglifier', '1.2.3' 
end
gem 'jquery-rails', '2.0.0'
group :test do
    gem 'capybara', '1.1.2'
    gem 'rb-fsevent', '0.4.3.1', :require => false
    gem 'growl', '1.0.3'
    gem 'guard-spork', '0.3.2'
    gem 'spork', '0.9.0'
end

~/.autotest

require 'autotest/growl'
require 'autotest/fsevent'
Autotest::Growl::show_modified_files = true
Autotest::Growl::one_notification_per_run = true
Autotest::Growl::clear_terminal = false
Autotest::Growl::hide_label = true

Autotest.add_hook :initialize do |autotest|
  autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do
    autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
  end  
end

$ autotest

loading autotest/rails


      --------------------------------------------------------------------------------

/Users/[me]/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit spec/requests/static_pages_spec.rb].each { |f| require f }"
/Users/[me]/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- spec_helper (LoadError)
    from        /Users/[me]/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from    /Users/[me]/programing/rails/rdale_house/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
    from /Users/[me]/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/[me]/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from -e:1:in `block in <main>'
    from -e:1:in `each'
    from -e:1:in `<main>'

spec/spec_helper.rb

require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'

Spork.prefork do
  # Loading more in this block will cause your tests to run faster. However,
  # if you change any configuration or code from libraries loaded here, you'll
  # need to restart spork for it take effect.

  # This file is copied to spec/ when you run 'rails generate rspec:install'
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  require 'rspec/autorun'

  # Requires supporting ruby files with custom matchers and macros, etc,
  # in spec/support/ and its subdirectories.
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

  RSpec.configure do |config|
    # ## Mock Framework
    #
    # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
    #
    # config.mock_with :mocha
    # config.mock_with :flexmock
    # config.mock_with :rr
    config.mock_with :rspec

    # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
    config.fixture_path = "#{::Rails.root}/spec/fixtures"

    # If you're not using ActiveRecord, or you'd prefer not to run each of your
    # examples within a transaction, remove the following line or assign false
    # instead of true.
    config.use_transactional_fixtures = true

    # If true, the base class of anonymous controllers will be inferred
    # automatically. This will be the default behavior in future versions of
    # rspec-rails.
    config.infer_base_class_for_anonymous_controllers = false
  end
end

Spork.each_run do
  # This code will be run each time you run your specs.

end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:06:18+00:00Added an answer on June 6, 2026 at 7:06 pm

    I ended up just adapting to Hartl’s workflow using Sublime Text 2 as well, however, I did want to make sure that I could switch over to Guard with Growl notifications if I ever wanted to (no need for autotest as far as I know since I believe that’s Guard’s job), so this is how I did it in my personal environment set up guide. Hope it can be of some assistance to you. I’m on OSX 10.6.8, so there may be some differences you need to do on 10.7.3:

    Setup Growl for RSpec test notifications (For Mac):
    Growl is likely already installed on the system, but growlnotify probably is not.

    1. Download the Growl-1.2.2.dmg file from here
    2. Open the dmg file and go to Extras > growlnotify > growlnotify.pkg
    3. Follow the wizard to install growlnotify

    Configure app for testing (RSpec, Cucumber with Spork and Guard):

    $ rails generate rspec:install
    $ rails generate cucumber:install
    

    Configure Spork (for RSpec and for Cucumber)

    $ spork --bootstrap
    $ spork cucumber --bootstrap
    

    Add environment loading

    $ subl spec/spec_helper.rb
    

    Move the entire contents under the Instructions into the Spork.prefork block to enable environment loading only once, and also add:

    config.mock_with :rspec
    

    Configure Guard:

    $ guard init rspec
    $ guard init spork
    

    Edit generated default file so Guard doesn’t run all tests after a failing test passes; drb flag is for Spork to run in distributed Ruby.

    $ subl Guardfile
    guard 'rspec', :version => 2, :all_after_pass => false, :cli => '--drb'  do
    

    Config to run test suite in distributed Ruby

    $ subl .rspec
    --drb
    

    Start Guard with Spork

    $ guard
    

    …and you should get Growl notifications.

    The related gems I have in my Gemfile are pretty much the same as yours.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've done the Michael Hartl's Tutorial and now I'm using it to build a
I am using Rails tutorial with example book by Michael Hartl as a reference
I just started reading Michael Hartl's Ruby on Rails 3 Tutorial. He recommends using
I making my Admin User using Michael Hartl's Rails 3 Tutorial .I am making
In Michael Hartl's Ruby on Rails Tutorial, ch 7.2.3 , rspec is returns the
I am practicing this RoR tutorial project of Michael Hartl: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book I am using
I'm following Michael Hartl's Rails Tutorial at the moment and I've managed to 7.22
I've completed the Michael Hartl Ruby on Rails Tutorial (for Rails 3) and I
I've completed the Michael Hartl Ruby on Rails Tutorial (for Rails 3) I'm trying
I am currently working through Michael Hartl's Rails Tutorial while experimenting with some other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.