RailsアプリにActiveAdminを導入後、Rspecを呼ぶと下記のエラーが発生するようになりました。
config/initializers/active_adminでActiveAdminを呼べていないようです。
検索を行い
・spec_helperにrequire
・node.jsをインストール
など試しましたが改善せず。
またActiveAdminはCoffee-railsと依存関係があるようなのですが、
Coffee-railsを途中でgemから削除してしまいました。再度インストールを行いましたがダメでした。
どのあたりに原因がありそうかご教示いただけますととても助かります。
よろしくお願い致します。
ruby 2.4.1
rails 5.2.0
activeadmin 1.3.0
※追記
・アプリ自体は動作します
・config/initializers/active_admin.rbを取り除くとテスト通りました
/Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.rb:53:in `bloc k in load_missing_constant': uninitialized constant ActiveAdmin (NameError) from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.r b:8:in `without_bootsnap_cache' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.r b:53:in `rescue in load_missing_constant' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/active_support.r b:43:in `load_missing_constant' from /Users/user_name/Programs/my_app/config/initializers/active_admin.rb:1:in `<main>' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.r b:50:in `load' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.r b:50:in `load' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:657:in `block in load_config_initi alizer' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:170:in `instr ument' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:656:in `load_config_initializer' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:614:in `block (2 levels) in <class :Engine>' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:613:in `each' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:613:in `block in <class:Engine>' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initial izers' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:421:in `block in each_strongly_connected_component_from' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:50:in `each' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:50:in `tsort_each_child' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:415:in `call' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:415:in `each_strongly_connected_component_from' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `call' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!' from /Users/user_name/Programs/my_app/config/environment.rb:5:in `<main>' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.r b:21:in `require' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.r b:21:in `block in require_with_bootsnap_lfi' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb: 65:in `register' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.r b:20:in `require_with_bootsnap_lfi' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.r b:29:in `require' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:102:in `preload' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Users/user_name/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' from -e:1:in `<main>'
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.4.1' 5 6gem 'rails', '~> 5.2.0' 7gem 'pg', '>= 0.18', '< 2.0' 8gem 'puma', '~> 3.11' 9gem 'sass-rails', '~> 5.0' 10gem 'uglifier', '>= 1.3.0' 11gem 'simple_form' 12gem 'turbolinks', '~> 5' 13gem 'jbuilder', '~> 2.5' 14gem 'geocoder' 15gem 'gon' 16gem 'jquery-rails' 17gem 'bootstrap-sass' 18gem 'slim-rails' 19gem 'carrierwave' 20gem 'devise' 21gem 'devise-bootstrap-views' 22gem 'toastr-rails' 23gem 'bootsnap', '>= 1.1.0', require: false 24 25group :development, :test do 26 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 27end 28 29group :development do 30 gem 'web-console', '>= 3.3.0' 31 gem 'listen', '>= 3.0.5', '< 3.2' 32 gem 'rspec-rails', '~> 3.6.0' 33 gem 'factory_bot_rails', '~> 4.10.0' 34 gem 'spring-commands-rspec' 35 gem 'spring' 36 gem 'spring-watcher-listen', '~> 2.0.0' 37 gem 'better_errors' 38 gem 'binding_of_caller' 39 gem 'pry-byebug' 40 gem 'rack-mini-profiler', require: false 41 gem 'activeadmin' 42end 43 44group :development,:test do 45 gem 'pry-rails' 46end 47 48group :test do 49 gem 'capybara', '>= 2.15', '< 4.0' 50 gem 'selenium-webdriver' 51 gem 'chromedriver-helper' 52end 53 54gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/02 00:34 編集
2018/08/02 01:49
2018/08/02 01:55