I\'m trying to follow this tutorial here: http://railstutorial.org/chapters/static-pages#top
When I run:
$ rails generate rspec:install
Add gem 'rspec-rails'
in Gemfile
and save it. Run bundle
command in Terminal. And in config/application.rb
, add this line of configuration
config.generators do |g|
g.test_framework :rspec, :fixture => true, :views => false
g.integration_tool :rspec, :fixture => true, :views => true
end
Make sure you install rspec-rails
and not only rspec
. Sigh, I lost some time.
Restart spring - sometimes it fails to reload after running bundle.
Add to your Gemfile:
group :development, :test do
gem 'rspec-rails', ">= 2.0.0.beta"
end
and run bundle install
That installed nokogiri
and afterwards rails generate rspec:install
ran as expected.
By default I had only 'rspec-rails'
in my gemfile, and so bundler installed rspec-rails 1.x (some prehistoric version) for some reason. After I modified my gemfile to have gem 'rspec-rails', '~>3.0'
and ran bundle update it ran fine.
I got this same error and found that i had forgotten to save the Gemfile changes I made in Sublime prior to running the Bundle install command. I saved and then reran the bundle install and was able to run the rails generate rspec:install command