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

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

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

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

Git

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

Heroku

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

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

Q&A

解決済

1回答

1547閲覧

RailsアプリをHerokuへデプロイ

ymatt

総合スコア20

Ruby

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

Git

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

Heroku

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

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

0グッド

0クリップ

投稿2017/04/10 15:06

編集2017/04/10 15:36

###前提・実現したいこと
Ruby on railsで作成した簡単なウェブアプリをHerokuへデプロイしようとしているのですが、以下エラーが発生しています。

###発生している問題・エラーメッセージ

Y-MacBook:y_ts ytktw$ git push heroku master Counting objects: 174, done. Delta compression using up to 4 threads. Compressing objects: 100% (165/165), done. Writing objects: 100% (174/174), 1.85 MiB | 178.00 KiB/s, done. Total 174 (delta 15), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.2.6 remote: -----> Installing dependencies using bundler 1.13.7 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Fetching gem metadata from https://rubygems.org/.......... remote: Fetching version metadata from https://rubygems.org/.. remote: Fetching dependency metadata from https://rubygems.org/. remote: Installing i18n 0.8.1 remote: Installing rake 12.0.0 remote: Installing json 1.8.6 with native extensions 文字数の関係で中略 remote: Installing ref 2.0.0 remote: Installing sqlite3 1.3.13 with native extensions remote: Installing turbolinks-source 5.0.0 remote: Installing tzinfo 1.2.3 remote: Installing nokogiri 1.7.1 with native extensions remote: Installing rack-test 0.6.3 remote: Installing mime-types 3.1 remote: Installing uglifier 3.2.0 remote: Installing autoprefixer-rails 6.7.7.1 remote: Installing coffee-script 2.4.1 remote: Installing sprockets 3.7.1 remote: Installing pry 0.10.4 remote: Installing less 2.6.0 remote: Installing rails_12factor 0.0.3 remote: Installing therubyracer 0.12.3 with native extensions remote: Installing turbolinks 5.0.1 remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. remote: /tmp/build_25f4374910eaa0ccc980caeba0c937c2/vendor/ruby-2.2.6/bin/ruby -r remote: ./siteconf20170410-232-1nq8tul.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 libsqlite3-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, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for more details. You may remote: need configuration options. 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_25f4374910eaa0ccc980caeba0c937c2/vendor/ruby-2.2.6/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: extconf failed, exit code 1 remote: Gem files will remain installed in remote: /tmp/build_25f4374910eaa0ccc980caeba0c937c2/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.13 remote: for inspection. remote: Results logged to remote: /tmp/build_25f4374910eaa0ccc980caeba0c937c2/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.13/gem_make.out 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'` succeeds before bundling. remote: Bundler Output: Fetching gem metadata from https://rubygems.org/.......... 文字数の関係で中略 remote: Installing rails_12factor 0.0.3 remote: Installing therubyracer 0.12.3 with native extensions remote: Installing turbolinks 5.0.1 remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. remote: remote: /tmp/build_25f4374910eaa0ccc980caeba0c937c2/vendor/ruby-2.2.6/bin/ruby -r remote: ./siteconf20170410-232-1nq8tul.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 libsqlite3-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, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for 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_25f4374910eaa0ccc980caeba0c937c2/vendor/ruby-2.2.6/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: extconf failed, exit code 1 remote: remote: Gem files will remain installed in remote: /tmp/build_25f4374910eaa0ccc980caeba0c937c2/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.13 remote: for inspection. remote: Results logged to remote: /tmp/build_25f4374910eaa0ccc980caeba0c937c2/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.13/gem_make.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'` succeeds before bundling. 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 quiet-sands-00000. remote: To https://git.heroku.com/quiet-sands-00000.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/quiet-sands-00000.git'

###Gem file

source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.6' # Use sqlite3 as the database for Active Record gem 'sqlite3', '1.3.13' # 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.1.0' # 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 following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use Unicorn as the app server # gem 'unicorn' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' end group :development do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end gem 'pry-rails' gem 'therubyracer' gem 'twitter-bootstrap-rails' gem 'bootstrap-material-design', '0.1.4' group :production do gem 'rails_12factor' gem 'pg' end

###補足情報
参照していたチュートリアルでは、mysqlを使う場合とpostgresqlを使う場合の2通りが記述されており、どちらの場合で進めても同じsqlite3のエラーが出ます。sqlite3 is missingとあるので、brew installしてみましたが変化はありませんでした。なお、ローカルでの開発はmysqlを使用、今回デプロイ段階で初めてpostgresqlをインストールした形です。

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

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

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

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

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

guest

回答1

0

自己解決

https://simonecarletti.com/blog/2016/01/post-heroku-sqlite/
上記の通り実行したら解決しました。いろいろ難しいことが書かれている記事が多い中、簡潔で分かりやすかったです。

投稿2017/04/10 17:08

ymatt

総合スコア20

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問