= Upgrade to Version 3.x
:doctype: book

== Configuration File Update

In version 3.x:

 - cop departments are extracted to another gem. (`Capybara`, `FactoryBot`, `Rails`)

[discrete]
=== Extraction of cop departments. (`Capybara`, `FactoryBot`, `Rails`)

If you are using the RSpec/Capybara, RSpec/FactoryBot, or RSpec/Rails departments -- or have one in a `require` list in your rubocop.yml -- you need to install the corresponding gem and add it to your `.rubocop.yml` file:

* Capybara: `rubocop-capybara`
* FactoryBot: `rubocop-factory_bot`
* Rails: `rubocop-rspec_rails`

For example, if you are using the RSpec/Capybara department, you need to install the `rubocop-capybara` gem and add it to your `.rubocop.yml` file:

[source,ruby]
----
# Gemfile
group :test do
  gem 'rubocop-rspec'
  gem 'rubocop-capybara'
end
----

[source,yaml]
----
require:
  - rubocop-rspec
  - rubocop-capybara
----

And you need to remove the old department in your `.rubocop.yml` file:

[source,yaml]
----
RSpec/Capybara:
  Enabled: false
----

For another example, if you are not using these departments, you don't need to do anything.
And when you update to RuboCop RSpec v3.0.0, you need to remove the old departments from your `.rubocop.yml` file, e.g.:

[source,yaml]
----
RSpec/Capybara:
  Enabled: false
RSpec/FactoryBot:
  Enabled: false
RSpec/Rails:
  Enabled: false
----

== Troubleshooting

If you're seeing `cannot load such file` when running rubocop, even after installing the gems, restart the server with `rubocop --restart-server`.
