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

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

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

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

Heroku

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

Q&A

解決済

2回答

1940閲覧

RailsアプリのHerokuデプロイ時のエラーが直りません。

pekapekatail

総合スコア32

Ruby

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

Heroku

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

0グッド

0クリップ

投稿2018/05/13 12:12

どんなに調べてもHerokuへのデプロイを行うことができません。どなたかお力を貸して頂けると幸いです。

エラー

  • (制限字数をオーバーしてしまうので一部省略してあります)
  • XXXXXはherokuに登録しているアプリ名です
$ git push heroku master Counting objects: 8942, done. Delta compression using up to 4 threads. Compressing objects: 100% (8320/8320), done. Writing objects: 100% (8942/8942), 38.02 MiB | 1.59 MiB/s, done. Total 8942 (delta 1019), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: ! Warning: Multiple default buildpacks reported the abi lity to handle this app. The first buildpack in the list below will be used. remote: Detected buildpacks: Ruby,Node.js remote: See https://devcenter.heroku.com/art icles/buildpacks#buildpack-detect-order remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.3.7 remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test -- path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Warning: the running version of Bundler (1.15.2) is o lder than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem instal l bundler`. remote: Fetching gem metadata from https://rubygems.org/..... ... remote: Fetching version metadata from https://rubygems.org/. . remote: Fetching dependency metadata from https://rubygems.or g/. remote: Fetching rake 12.3.1 remote: Fetching concurrent-ruby 1.0.5 remote: Fetching minitest 5.11.3 remote: Installing rake 12.3.1 (~~~省略:InstallingとFetchingが続く~~~) remote: Installing activesupport 5.1.6 remote: Gem::Ext::BuildError: ERROR: Failed to build gem nati ve extension. remote: remote: current directory: remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3 remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/ru by-2.3.7/bin/ruby -r remote: ./siteconf20180513-253-1utdlov.rb extconf.rb remote: checking for sqlite3.h... no remote: sqlite3.h is missing. Try 'brew install sqlite3', remote: 'yum install sqlite-devel' or 'apt-get install libsql ite3-dev' remote: and check your shared library search path (the remote: location where your sqlite3 shared library is located ). remote: *** extconf.rb failed *** remote: Could not create Makefile due to some reason, probabl y lack of necessary remote: libraries and/or headers. Check the mkmf.log file fo r more details. You may remote: need configuration options. remote: remote: Provided configuration options: remote: --with-opt-dir remote: --without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote: --with-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/ve ndor/ruby-2.3.7/bin/$(RUBY_BASE_NAME) remote: --with-sqlite3-config remote: --without-sqlite3-config remote: --with-pkg-config remote: --without-pkg-config remote: --with-sqlite3-dir remote: --without-sqlite3-dir remote: --with-sqlite3-include remote: --without-sqlite3-include=${sqlite3-dir}/include remote: --with-sqlite3-lib remote: --without-sqlite3-lib=${sqlite3-dir}/lib remote: remote: To see why this extension failed to compile, please c heck the mkmf.log which can remote: be found here: remote: remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.lo g remote: remote: extconf failed, exit code 1 remote: remote: Gem files will remain installed in remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/gems/sqlite3-1.3.13 remote: for inspection. remote: Results logged to remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_mak e.out remote: remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot remote: continue. remote: Make sure that `gem install sqlite3 -v '1.3.13'` succ eeds before bundling. remote: remote: In Gemfile: remote: sqlite3 remote: Bundler Output: Warning: the running version of Bundl er (1.15.2) is older than the version that created the lockfile (1.1 6.1). We suggest you upgrade to the latest version of Bundler by run ning `gem install bundler`. remote: Fetching gem metadata from https://rubygems.org/..... ... remote: Fetching version metadata from https://rubygems.org/. . remote: Fetching dependency metadata from https://rubygems.or g/. remote: Fetching rake 12.3.1 remote: Fetching concurrent-ruby 1.0.5 (~~~省略:InstallingとFetchingが続く~~~) remote: Installing activesupport 5.1.6 remote: Gem::Ext::BuildError: ERROR: Failed to build gem nati ve extension. remote: remote: current directory: remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3 remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/ru by-2.3.7/bin/ruby -r remote: ./siteconf20180513-253-1utdlov.rb extconf.rb remote: checking for sqlite3.h... no remote: sqlite3.h is missing. Try 'brew install sqlite3', remote: 'yum install sqlite-devel' or 'apt-get install libsql ite3-dev' remote: and check your shared library search path (the remote: location where your sqlite3 shared library is located ). remote: *** extconf.rb failed *** remote: Could not create Makefile due to some reason, probabl y lack of necessary remote: libraries and/or headers. Check the mkmf.log file fo r more details. You may remote: need configuration options. remote: remote: Provided configuration options: remote: --with-opt-dir remote: --without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote: --with-make-prog remote: --without-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/ve ndor/ruby-2.3.7/bin/$(RUBY_BASE_NAME) remote: --with-sqlite3-config remote: --without-sqlite3-config remote: --with-pkg-config remote: --without-pkg-config remote: --with-sqlite3-dir remote: --without-sqlite3-dir remote: --with-sqlite3-include remote: --without-sqlite3-include=${sqlite3-dir}/include remote: --with-sqlite3-lib remote: --without-sqlite3-lib=${sqlite3-dir}/lib remote: remote: To see why this extension failed to compile, please c heck the mkmf.log which can remote: be found here: remote: remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.lo g remote: remote: extconf failed, exit code 1 remote: remote: Gem files will remain installed in remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/gems/sqlite3-1.3.13 remote: for inspection. remote: Results logged to remote: /tmp/build_cffd92476daf50cbcc0ddddd7e5ac406/vendor/bu ndle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_mak e.out remote: remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot remote: continue. remote: Make sure that `gem install sqlite3 -v '1.3.13'` succ eeds before bundling. remote: remote: In Gemfile: remote: sqlite3 remote: ! remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku : remote: ! https://devcenter.heroku.com/articles/sqlite3 remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to XXXXX. remote: To https://git.heroku.com/XXXXX.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/XXXXX.git'

試したこと

herokuではsqlite3ではなくpgを使うべきだという話は聞いていたので、gemfileでdevelopment環境下ではpgを使うように指定しましたが、エラーは変わらずでした。問題はsqlite3/pg以外にあるのでしょうか?
全くどうしてよいかわからず、お力貸して頂けると幸いです。

参考にした記事

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

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

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

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

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

guest

回答2

0

本番でpgを使うのであればgroup :production do〜end内にpgを置いて、group :development, :test do〜end内にsqlite3を置く必要があったのでは?

投稿2018/05/14 03:18

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

0

自己解決

質問補足:すみません、文字数の都合でGemfileとdatabase.ymlの状況を記載できませんでした。これらについては下記の通りです。

Gemfile

source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end gem 'rails', '~> 5.1.6' gem 'pg' gem 'puma', '~> 3.7' gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.2' gem 'turbolinks', '~> 5' gem 'jbuilder', '~> 2.5' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] # Adds support for Capybara system testing and selenium driver gem 'capybara', '~> 2.13' gem 'selenium-webdriver' gem 'pry-rails' # rails console(もしくは、rails c)でirbの代わりにpryを使われる gem 'pry-doc' # methodを表示 gem 'pry-byebug' # デバッグを実施(Ruby 2.0以降で動作する) gem 'pry-stack_explorer' # スタックをたどれる gem 'hirb' # モデルの出力結果を表形式で表示するGem gem 'hirb-unicode' # 日本語などマルチバイト文字の出力時の出力結果のずれに対応 gem 'better_errors' gem "binding_of_caller" gem 'sqlite3', require: false end group :development do # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' # 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' end gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'devise' gem 'omniauth-facebook' gem 'dotenv-rails', require: 'dotenv/rails-now' gem 'thin' gem 'carrierwave' gem 'rails-erd' gem 'jquery-rails'

database.yml

# SQLite version 3.x # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' # default: &default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: <<: *default database: db/development.sqlite3 test: <<: *default database: db/test.sqlite3 production: <<: *default adapter: postgresql encoding: unicode pool: 5

投稿2018/05/13 12:13

編集2018/05/13 12:14
pekapekatail

総合スコア32

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問