       @rubocopOutput(buffer.getBaseName(), rubocop.stdout)
 
   autoCorrectFile: (filePath)  ->
-    commandWithArgs = atom.config.get('rubocop-auto-correct.rubocopCommandPath')
-                                .split(/\s+/).filter((i) -> i)
-                                .concat(['-a', filePath])
-                                .concat(@projectRootRubocopConfig(filePath))
-    command = commandWithArgs[0]
-    args = commandWithArgs[1..]
-
-    which command, (err) ->
-      if (err)
-        return atom.notifications.addFatalError(
-          "Rubocop command is not found.",
-          { detail: '''
-          When you don't install rubocop yet, Run `gem install rubocop` first.\n
-          If you already installed rubocop, Please check package setting at `Rubocop Command Path`.
-          ''' }
-        )
+    rubocopCommand = @rubocopCommand()
+    command = rubocopCommand[0]
+    args = rubocopCommand[1]
+      .concat(['-a', filePath])
+      .concat(@projectRootRubocopConfig(filePath))
 
     stdout = (output) =>
       @rubocopOutput(filePath.replace(/.+\//, ""), output)

          If you already installed rubocop, Please check package setting at `Rubocop Command Path`.
          ''' }
        )

    rubocop = spawnSync(command, args, { encoding: 'utf-8', timeout: 5000 })


      offenses.map (offense) ->
        message = offense.replace(re, fileName + "$1")
        console.log(message) if debug
        atom.notifications.addWarning(message) if notification
    else if output.match("no offenses")
      atom.notifications.addSuccess(output) if notification
    else
      atom.notifications.addInfo(output) if notification

  makeTempFile: (filename) ->
    directory = temp.mkdirSync()
