rails 5 系で gem ransack関連のエラーです。
ruby:2.4.5
docker ver 3
です。
csv ファイルを読み込む関係で require 'csv'
gem devise を日本語化するため gem 'devise-i18n'
を入れたところ、
docker-compose upで下記エラーでコンテナが立ち上がらなくなりました。
ransackを使って、検索機能を実装したのですが、これは問題なく機能していました。
上記gemとコンフリクトを起こしているのでしょうか?
調べても、情報は下記ぐらいで、あまり理解できずにいます。
There was an error while trying to load the gem 'activeadmin'. #4756
There was an error while trying to load the gem 'ransack'. (Bundler::GemRequireError) Gem Load Error is: undefined method `require_constants' for nil:NilClass #890
お助けいただければ幸いです。
コンソール
web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'ransack'. (Bundler::GemRequireError) web_1 | Gem Load Error is: Unsupported adapter web_1 | Backtrace for gem load error is: web_1 | /usr/local/bundle/gems/ransack-2.3.0/lib/ransack/adapters.rb:14:in `instantiate_object_mapper' web_1 | /usr/local/bundle/gems/ransack-2.3.0/lib/ransack/adapters.rb:5:in `object_mapper' web_1 | /usr/local/bundle/gems/ransack-2.3.0/lib/ransack.rb:6:in `<top (required)>' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `require' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:81:in `block (2 levels) in require' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `each' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:76:in `block in require' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `each' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler/runtime.rb:65:in `require' web_1 | /usr/local/lib/ruby/site_ruby/2.4.0/bundler.rb:114:in `require' web_1 | /app/config/application.rb:7:in `<top (required)>' web_1 | /usr/local/bundle/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:88:in `require' web_1 | /usr/local/bundle/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:88:in `block in server' web_1 | /usr/local/bundle/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:85:in `tap' (途中略) test_csv_app_web_1 exited with code 1
Gemfile
1source 'https://rubygems.org' 2 3 4# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5gem 'rails', '~> 5.0.0', '>= 5.0.0.1' 6# Use mysql as the database for Active Record 7gem 'mysql2', '>= 0.3.18', '< 0.5' 8# Use Puma as the app server 9gem 'puma', '~> 3.0' 10# Use SCSS for stylesheets 11gem 'sass-rails', '~> 5.0' 12# Use Uglifier as compressor for JavaScript assets 13gem 'uglifier', '>= 1.3.0' 14# Use CoffeeScript for .coffee assets and views 15gem 'coffee-rails', '~> 4.2' 16# See https://github.com/rails/execjs#readme for more supported runtimes 17# gem 'therubyracer', platforms: :ruby 18 19# Use jquery as the JavaScript library 20gem 'jquery-rails' 21# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 22gem 'turbolinks', '~> 5' 23# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 24gem 'jbuilder', '~> 2.5' 25# Use Redis adapter to run Action Cable in production 26# gem 'redis', '~> 3.0' 27# Use ActiveModel has_secure_password 28gem 'bcrypt', '~> 3.1.7' 29 30#device 31gem 'devise' 32 33# for json api 34gem 'active_model_serializers' 35 36# ransack 37gem 'ransack' 38 39# Use Capistrano for deployment 40# gem 'capistrano-rails', group: :development 41gem 'mini_racer' 42gem 'bootstrap', '~> 4.5.0' 43gem 'kaminari' 44gem 'faker' 45gem 'roo' 46gem 'enum_help' 47# gem 'devise-i18n' 48 49group :development, :test do 50 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 51 gem 'byebug', platform: :mri 52 gem 'rspec-rails' 53 gem "devise_token_auth" 54 gem "rack-cors" 55 gem 'rails-controller-testing' 56 gem 'factory_bot' 57 gem 'active_hash' 58end 59 60group :development do 61 # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 62 gem 'web-console' 63 gem 'listen', '~> 3.0.5' 64 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 65 gem 'spring' 66 gem 'spring-watcher-listen', '~> 2.0.0' 67 gem 'pry-byebug' 68 gem 'annotate' 69end 70 71# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 72gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 73
Docker
1version: '3' 2services: 3 web: 4 build: . 5 command: bundle exec rails s -p 3000 -b '0.0.0.0' 6 volumes: 7 - .:/app 8 ports: 9 - 3000:3000 10 depends_on: 11 - db 12 tty: true 13 stdin_open: true 14 environment: 15 TZ: Asia/Tokyo 16 db: 17 image: mysql:8.0.21 18 volumes: 19 - db-volume:/var/lib/mysql 20 environment: 21 MYSQL_ROOT_PASSWORD: password 22volumes: 23 db-volume:
あなたの回答
tips
プレビュー