Update the Gemfile

In your Gemfile, add:

group :development, :test do
  gem 'rspec-rails'
  gem 'factory_girl_rails'
end
group :test do
  gem 'capybara'
  gem 'database_cleaner'
  gem 'launchy'
  gem 'selenium-webdriver'
end

We install the gems in two groups.

The rspec-rails and factory_girl_rails gems are used in both development
and testing. In development, if you use Rails generators to create
models or controllers, the rspec-rails and factory_girl_rails gems will
create simple “stub” files for your tests. These gems must also be
available in the test environment.

The other gems are only used when running tests, so they can be
segregated in a test group so they are not loaded in development or
production.