```ruby
require 'rubocop/rake_task'

RuboCop::RakeTask.new
```

Disable Rubocop task when Rubocop gem is unavailable to fix issue in production
user
```ruby
begin
  require 'rubocop/rake_task'
  RuboCop::RakeTask.new
rescue LoadError
  desc 'Disabled as RuboCop gem is unavailable'
  task :rubocop do 
    raise 'Disabled as RuboCop gem is unavailable'
  end
end
```
assistant