前提・実現したいこと
現在AWS cloud9を使ってRuby on railsの学習をしています。
Herokuでデプロイするためにgemfileを修正、bundle installを行なっているのですがエラーが発生します。
発生している問題・エラーメッセージ
gemfile変更箇所 gem 'sqlite3' から gem 'sqlite3',group: :development gem 'pg',group: :production bundle install結果 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... Using rake 12.3.1 Using concurrent-ruby 1.0.5 Using i18n 1.0.1 Using minitest 5.11.3 Using thread_safe 0.3.6 Using tzinfo 1.2.5 Using activesupport 5.2.0 Using builder 3.2.3 Using erubi 1.7.1 Using mini_portile2 2.3.0 Using nokogiri 1.8.2 Using rails-dom-testing 2.0.3 Using crass 1.0.4 Using loofah 2.2.2 Using rails-html-sanitizer 1.0.4 Using actionview 5.2.0 Using rack 2.0.5 Using rack-test 1.0.0 Using actionpack 5.2.0 Using nio4r 2.3.1 Using websocket-extensions 0.1.3 Using websocket-driver 0.7.0 Using actioncable 5.2.0 Using globalid 0.4.1 Using activejob 5.2.0 Using mini_mime 1.0.0 Using mail 2.7.0 Using actionmailer 5.2.0 Using activemodel 5.2.0 Using arel 9.0.0 Using activerecord 5.2.0 Using mimemagic 0.3.2 Using marcel 0.3.2 Using activestorage 5.2.0 Using public_suffix 3.0.2 Using addressable 2.5.2 Using io-like 0.3.0 Using archive-zip 0.11.0 Using bindex 0.5.0 Using msgpack 1.2.4 Using bootsnap 1.3.0 Using bundler 1.16.1 Using byebug 10.0.2 Using xpath 3.0.0 Using capybara 3.0.3 Using ffi 1.9.23 Using childprocess 0.9.0 Using chromedriver-helper 1.2.0 Using coffee-script-source 1.12.2 Using execjs 2.7.0 Using coffee-script 2.4.1 Using method_source 0.9.0 Using thor 0.20.0 Using railties 5.2.0 Using coffee-rails 4.2.2 Using multi_json 1.13.1 Using jbuilder 2.7.0 Using rb-fsevent 0.10.3 Using rb-inotify 0.9.10 Using ruby_dep 1.5.0 Using listen 3.1.5 Fetching pg 1.0.0 Installing pg 1.0.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/local/rvm/gems/ruby-2.4.1/gems/pg-1.0.0/ext /usr/local/rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180511-4117-yb6kc9.rb extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib To see why this extension failed to compile, please check the mkmf.log which can be found here: /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/pg-1.0.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /usr/local/rvm/gems/ruby-2.4.1/gems/pg-1.0.0 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/pg-1.0.0/gem_make.out An error occurred while installing pg (1.0.0), and Bundler cannot continue. Make sure that `gem install pg -v '1.0.0'` succeeds before bundling. In Gemfile: pg
該当のソースコード
ruby
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.4.1' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.0' 8# Use sqlite3 as the database for Active Record 9gem 'sqlite3',group: :development 10gem 'pg',group: :production 11# Use Puma as the app server 12gem 'puma', '~> 3.11' 13# Use SCSS for stylesheets 14gem 'sass-rails', '~> 5.0' 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# gem 'capistrano-rails', group: :development 36 37# Reduces boot times through caching; required in config/boot.rb 38gem 'bootsnap', '>= 1.1.0', require: false 39 40group :development, :test do 41 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 42 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 43end 44 45group :development do 46 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 47 gem 'web-console', '>= 3.3.0' 48 gem 'listen', '>= 3.0.5', '< 3.2'
試したこと
特になし
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。