ume

RSpecファイル読み込めないエラー

対象者

この記事を読んでわかること

目次

  1. エラー内容.

  2. 解決策.

1. エラー内容.

Failure/Error: Unable to infer file and line number from backtrace
          
          Selenium::WebDriver::Error::UnknownError:
            unknown error: Chrome failed to start: exited abnormally.
              (unknown error: DevToolsActivePort file doesn't exist)
              (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

2. 解決策

spec/spec_helper.rbの中の↓の中に

RSpec.configure do |config|
  
end

RSpec.configure do |config|
    config.before(:each, type: :system) do 
    driven_by :rack_test
end 

このようにすると治りました。