質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

465閲覧

Herokuへのデプロイエラー

gymusel

総合スコア4

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/11/26 10:50

前提・実現したいこと

Ruby on Railsで開発したプロダクトをHerokuを使ってデプロイしたいのですが、エラーが出てどうしても自力で解決できませんでした。

以下に全文を載せておきますので、アドバイスくださると嬉しいです。

発生しているエラーメッセージ

! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order -----> Ruby app detected -----> Installing bundler 1.17.3 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.6.3 -----> Installing dependencies using bundler 1.17.3 Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4 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 rake 13.0.1 Installing rake 13.0.1      <割愛> Fetching sass-rails 6.0.0 Installing sass-rails 6.0.0 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3 /tmp/build_b9010875_/vendor/ruby-2.6.3/bin/ruby -I /tmp/build_b9010875_/vendor/ruby-2.6.3/lib/ruby/2.6.0 -r ./siteconf20201126-275-1e3viuh.rb extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'brew install sqlite3', 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' and check your shared library search path (the location where your sqlite3 shared library is located). *** 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=/tmp/build_b9010875_/vendor/ruby-2.6.3/bin/$(RUBY_BASE_NAME) --with-sqlcipher --without-sqlcipher --with-sqlite3-config --without-sqlite3-config --with-pkg-config --without-pkg-config --with-sqlcipher --without-sqlcipher --with-sqlite3-dir --without-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib To see why this extension failed to compile, please check the mkmf.log which can be found here: /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2 for inspection. Results logged to /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/gem_make.out An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue. Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: sqlite3 Bundler Output: 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 rake 13.0.1 Installing rake 13.0.1      <割愛> Fetching sass-rails 6.0.0 Installing sass-rails 6.0.0 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3 /tmp/build_b9010875_/vendor/ruby-2.6.3/bin/ruby -I /tmp/build_b9010875_/vendor/ruby-2.6.3/lib/ruby/2.6.0 -r ./siteconf20201126-275-1e3viuh.rb extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'brew install sqlite3', 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' and check your shared library search path (the location where your sqlite3 shared library is located). *** 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=/tmp/build_b9010875_/vendor/ruby-2.6.3/bin/$(RUBY_BASE_NAME) --with-sqlcipher --without-sqlcipher --with-sqlite3-config --without-sqlite3-config --with-pkg-config --without-pkg-config --with-sqlcipher --without-sqlcipher --with-sqlite3-dir --without-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib To see why this extension failed to compile, please check the mkmf.log which can be found here: /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2 for inspection. Results logged to /tmp/build_b9010875_/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/gem_make.out An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue. Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: sqlite3 ! ! Failed to install gems via Bundler. ! Detected sqlite3 gem which is not supported on Heroku: ! https://devcenter.heroku.com/articles/sqlite3 ! ! Push rejected, failed to compile Ruby app. ! Push failed

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Getting Started on Heroku with Rails 6.x

If you’re using an existing app that was created without specifying --database=postgresql, you need to add the pg gem to your Rails project.
gem 'sqlite3'
To this:
gem 'pg'

以上のドキュメントに従いGemfileおよびdatabase.ymlを編集してください

投稿2020/11/26 11:10

編集2020/11/26 11:13
asm

総合スコア15147

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

asm

2020/11/26 11:14

ローカルでの開発も継続する場合はproduction環境のみpostgresを使うようにするとよいでしょう。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問