環境
cloud9
ruby 2.6.3
rails 5.1.6
Herokuにプッシュするために以下のコマンドを実行するとエラーが発生してしまいます。
ec2-user:~/environment/toy_app (master) $ git push heroku master Counting objects: 88, done. Compressing objects: 100% (74/74), done. Writing objects: 100% (88/88), 20.94 KiB | 1.23 MiB/s, done. Total 88 (delta 5), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: ! Warning: Multiple default buildpacks reported the ability 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/articles/buildpacks#buildpack-detect-order remote: -----> Ruby app detected remote: -----> Installing bundler 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock ~一部省略~ 0 remote: Fetching actionview 5.1.7 remote: Installing actionview 5.1.7 remote: Fetching actionpack 5.1.7 remote: Installing actionpack 5.1.7 remote: Fetching actioncable 5.1.7 remote: Fetching actionmailer 5.1.7 remote: Fetching railties 5.1.7 remote: Installing actioncable 5.1.7 remote: Installing actionmailer 5.1.7 remote: Installing railties 5.1.7 remote: Fetching sprockets-rails 3.2.1 remote: Installing sprockets-rails 3.2.1 remote: Fetching coffee-rails 4.2.2 remote: Fetching rails 5.1.7 remote: Fetching sass-rails 5.0.7 remote: Installing rails 5.1.7 remote: Installing coffee-rails 4.2.2 remote: Installing sass-rails 5.0.7 remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. remote: remote: current directory: remote: /tmp/build_37a5f20d089ab3c9564f8c001dadab45/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2/ext/sqlite3 remote: /tmp/build_37a5f20d089ab3c9564f8c001dadab45/vendor/ruby-2.6.5/bin/ruby -I remote: /tmp/build_37a5f20d089ab3c9564f8c001dadab45/vendor/ruby-2.6.5/lib/ruby/2.6.0 -r remote: ./siteconf20200308-254-1suzju9.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_37a5f20d089ab3c9564f8c001dadab45/vendor/ruby-2.6.5/bin/$(RUBY_BASE_NAME) remote: --with-sqlcipher remote: --without-sqlcipher remote: --with-sqlite3-config remote: --without-sqlite3-config remote: --with-pkg-config remote: --without-pkg-config remote: --with-sqlcipher remote: --without-sqlcipher 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 check the mkmf.log which can remote: be found here: remote: remote: /tmp/build_37a5f20d089ab3c9564f8c001dadab45/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/mkmf.log remote: remote: extconf failed, exit code 1 remote: remote: Gem files will remain installed in remote: /tmp/build_37a5f20d089ab3c9564f8c001dadab45/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2 remote: for inspection. remote: Results logged to remote: /tmp/build_37a5f20d089ab3c9564f8c001dadab45/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sqlite3-1.4.2/gem_make.out remote: remote: An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue. remote: Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'` remote: succeeds before bundling. remote: remote: In Gemfile: remote: sqlite3 remote: 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 polar-tundra-37862. remote: To https://git.heroku.com/polar-tundra-37862.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/polar-tundra-37862.git' ec2-user:~/environment/toy_app (master) $
以下エラー部分抜粋です。
remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku: remote: ! https://devcenter.heroku.com/articles/sqlite3
試したこと
エラー部分メッセージを読む限り、SQLiteが対応してない、ということかと思いましたがRailsチュートリアルの指示通りPostgreSQLと通信ができるようにgemファイルは以下のように編集済みです。
source 'https://rubygems.org' gem 'rails', '5.1.6' gem 'puma', '3.9.1' gem 'sass-rails', '5.0.6' gem 'uglifier', '3.2.0' gem 'coffee-rails', '4.2.2' gem 'jquery-rails', '4.3.1' gem 'turbolinks', '5.0.1' gem 'jbuilder', '2.7.0' group :development, :test do gem 'sqlite3', '1.3.13' gem 'byebug', '9.0.6', platform: :mri end group :development do gem 'web-console', '3.5.1' gem 'listen', '3.1.5' gem 'spring', '2.0.2' gem 'spring-watcher-listen', '2.0.1' end group :production do gem 'pg', '0.20.0' end # Windows環境ではtzinfo-dataというgemを含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
そして以下のコマンドも実行済みです
$ bundle install --without production $ git commit -a -m "Update Gemfile for Heroku" ``` 解決方法のご教授願います。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。