LoginSignup
3
2

More than 1 year has passed since last update.

Rspecでuninitialized constant Rack::MiniProfileがでて実行できない

Posted at

はじめに

この記事は2022年2月にまとめていた「細かいつまずいたことをメモしておく(2月編)をそれぞれ投稿した内容になります
解決方法が最新でない可能性もありますのでご了承ください

問題

Rspecを実行したところ以下のエラーが発生した

Failure/Error: require_relative '../config/environment'

NameError:
  uninitialized constant Rack::MiniProfiler
  Did you mean?  MiniMime

解決方法

Gemfilerack-mini-profilerequire: falseをつけて、/conifg/environment/rack-profile.rbを編集する

Gemfile
gem 'rack-mini-profiler', '~> 2.0', require: false
/config/environment/rack-profile.rb
if defined?(Rack::MiniProfiler)
  Rack::MiniProfiler.config.auto_inject = false
end

参考

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2