前提・実現したいこと
docker + rails 環境で、デバッグツールの"pry-bybug"を入れたところで、
「docker-compose up (-d)」をするとWebサーバが上がらなくなってしまいました。
発生している問題・エラーメッセージ
エラーメッセージ
web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'pry-byebug'. (Bundler::GemRequireError) web_1 | Gem Load Error is: uninitialized constant Pry::Command::ExitAll web_1 | Backtrace for gem load error is: web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug/commands/exit_all.rb:7:in `<module:PryByebug>' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug/commands/exit_all.rb:3:in `<top (required)>' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug/commands.rb:12:in `require' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug/commands.rb:12:in `<top (required)>' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug/cli.rb:5:in `require' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug/cli.rb:5:in `<top (required)>' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry/plugins.rb:55:in `require' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry/plugins.rb:55:in `load_cli_options' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry/cli.rb:40:in `each' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry/cli.rb:40:in `add_plugin_options' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry/cli.rb:134:in `<top (required)>' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry.rb:78:in `require' web_1 | /usr/local/bundle/gems/pry-0.13.1/lib/pry.rb:78:in `<top (required)>' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug.rb:3:in `require' web_1 | /usr/local/bundle/gems/pry-byebug-3.7.0/lib/pry-byebug.rb:3:in `<top (required)>' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `require' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `block (2 levels) in require' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `each' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `block in require' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `each' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `require' web_1 | /usr/local/lib/ruby/site_ruby/2.3.0/bundler.rb:114:in `require' web_1 | /app/config/application.rb:7:in `<top (required)>'
該当のソースコード
Gemfile
source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use mysql as the database for Active Record gem 'mysql2', '>= 0.3.18', '< 0.5' # Use Puma as the app server gem 'puma', '~> 3.0' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # See https://github.com/rails/execjs#readme for more supported runtimes #gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 3.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development gem 'bootstrap', '~> 4.0.0' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: :mri end group :development do # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. gem 'web-console' gem 'listen', '~> 3.0.5' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'pry-bybug' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Dockerfile
FROM ruby:2.3.6 #RUN apt-get update -qq && apt-get install -y build-essential nodejs RUN apt-get update -qq && apt-get install -y build-essential RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && apt-get install -y nodejs RUN mkdir /app WORKDIR /app COPY Gemfile /app/Gemfile COPY Gemfile.lock /app/Gemfile.lock RUN bundle install COPY . /app
docker-compose.yml
version: '3' services: web: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: - .:/app ports: - 3000:3000 depends_on: - db tty: true stdin_open: true db: image: mysql:5.7 volumes: - db-volume:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: password volumes: db-volume:
試したこと
色々とサイトを探しましたが、該当エラーメッセージの対処法が載っているものがありませんでした。
もしかすると初歩的なことかもしれませんが、対処法がありましたらご教示ください。