dockertoolboxで作ったrailsアプリをEC2よりデプロイするところに躓いております。
nokogiri関係のエラーだとは思うのですがなかなか解決できない状態です。
[ec2-user@ip-10-0-0-204 music_app]$ docker-compose up -d Building web Step 1/9 : FROM ruby:2.5.3 ---> 72aaaee1eea4 Step 2/9 : RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs ---> Using cache ---> ba3a0ac43ec4 Step 3/9 : RUN mkdir /app ---> Using cache ---> b741d13dfbfb Step 4/9 : WORKDIR /app ---> Using cache ---> 7fecb36373f4 Step 5/9 : COPY Gemfile /app/Gemfile ---> Using cache ---> a7238703e18e Step 6/9 : COPY Gemfile.lock /app/Gemfile.lock ---> Using cache ---> 56a4e2dd3755 Step 7/9 : RUN gem install bundler -v 2.1.4 ---> Using cache ---> ec8bb9f87983 Step 8/9 : RUN bundle install ---> Running in 8cb41c6dae3d The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. Fetching gem metadata from https://rubygems.org/............ Fetching gem metadata from https://rubygems.org/. Resolving dependencies....................... Fetching rake 13.0.1 Installing rake 13.0.1 Fetching concurrent-ruby 1.1.7 Installing concurrent-ruby 1.1.7 Fetching i18n 1.8.5 Installing i18n 1.8.5 Fetching minitest 5.14.2 Installing minitest 5.14.2 Fetching thread_safe 0.3.6 Installing thread_safe 0.3.6 Fetching tzinfo 1.2.8 Installing tzinfo 1.2.8 Fetching activesupport 5.2.4.4 Installing activesupport 5.2.4.4 Fetching builder 3.2.4 Installing builder 3.2.4 Fetching erubi 1.10.0 Installing erubi 1.10.0 Fetching mini_portile2 2.4.0 Installing mini_portile2 2.4.0 Fetching nokogiri 1.10.10 Installing nokogiri 1.10.10 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/local/bundle/ruby/2.5.0/gems/nokogiri-1.10.10/ext/nokogiri /usr/local/bin/ruby -I /usr/local/lib/ruby/site_ruby/2.5.0 -r ./siteconf20201114-6-6rqabz.rb extconf.rb extconf failedCannot allocate memory - /usr/local/bin/ruby Gem files will remain installed in /usr/local/bundle/ruby/2.5.0/gems/nokogiri-1.10.10 for inspection. Results logged to /usr/local/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.10/gem_make.out An error occurred while installing nokogiri (1.10.10), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.10.10' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rails-flog was resolved to 1.6.0, which depends on rails was resolved to 5.2.4.4, which depends on actioncable was resolved to 5.2.4.4, which depends on actionpack was resolved to 5.2.4.4, which depends on actionview was resolved to 5.2.4.4, which depends on rails-dom-testing was resolved to 2.0.3, which depends on nokogiri ERROR: Service 'web' failed to build: The command '/bin/sh -c bundle install' returned a non-zero code: 5
Dockerfile
1FROM ruby:2.5.3 2RUN apt-get update -qq && \ 3 apt-get install -y build-essential \ 4 libpq-dev \ 5 nodejs 6RUN mkdir /app 7WORKDIR /app 8COPY Gemfile /app/Gemfile 9COPY Gemfile.lock /app/Gemfile.lock 10RUN gem install bundler -v 2.1.4 11RUN bundle install 12COPY . /app 13
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.3' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.2' 8 9# Use mysql as the database for Active Record 10gem 'mysql2', '>= 0.4.4', '< 0.6.0' 11# Use Puma as the app server 12gem 'puma', '~> 3.11' 13# Use SCSS for stylesheets 14gem 'sass-rails' 15# Use Uglifier as compressor for JavaScript assets 16gem 'uglifier', '>= 1.3.0' 17# See https://github.com/rails/execjs#readme for more supported runtimes 18# gem 'mini_racer', platforms: :ruby 19 20# Use CoffeeScript for .coffee assets and views 21gem 'coffee-rails', '~> 4.2' 22# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 23gem 'turbolinks', '~> 5' 24# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 25gem 'jbuilder', '~> 2.5' 26# Use Redis adapter to run Action Cable in production 27# gem 'redis', '~> 4.0' 28# Use ActiveModel has_secure_password 29# gem 'bcrypt', '~> 3.1.7' 30 31# Use ActiveStorage variant 32# gem 'mini_magick', '~> 4.8' 33 34# Use Capistrano for deployment 35# Reduces boot times through caching; required in config/boot.rb 36gem 'bootsnap', '>= 1.1.0', require: false 37gem 'bootstrap', '~> 4.4.1' 38gem 'jquery-rails' 39gem 'mini_racer' 40gem 'carrierwave' 41gem "mini_magick" 42gem 'kaminari' 43gem "rails-i18n" 44gem 'devise' 45gem 'devise-i18n' 46gem 'devise-i18n-views' 47gem 'dotenv-rails' 48group :development, :test do 49 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 50 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 51 gem 'rspec-rails', '~> 3.8' 52 gem "factory_bot_rails", "~> 4.10.0" 53 gem "rails-flog", require: "flog" 54end 55 56group :development do 57 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 58 gem 'web-console', '>= 3.3.0' 59 gem 'listen', '>= 3.0.5', '< 3.2' 60 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 61 gem 'spring' 62 gem 'spring-watcher-listen', '~> 2.0.0' 63 gem 'spring-commands-rspec' 64 gem 'pry-byebug' 65gem "annotate" 66 gem 'letter_opener_web' 67end 68 69group :production, :staging do 70 gem 'unicorn' 71end 72 73group :test do 74 # Adds support for Capybara system testing and selenium driver 75 gem 'capybara', '>= 2.15' 76 gem 'selenium-webdriver' 77 # Easy installation and use of chromedriver to run system tests with Chrome 78 gem 'chromedriver-helper' 79 gem 'pry-rails' 80end 81 82# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 83gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
もし、わかる方がいれば教えていただけると幸いです。宜しくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。