前提・実現したいこと
オリジナルアプリをsqlite3で作成していまして途中からデータベースをMysqlに変更しました。
そろそろherokuにデプロイでもしよっかなと思いググってherokuへのデプロイまでの設定を一通り行いgit push heroku masterしたら以下のエラーが出てきました。
発生している問題・エラーメッセージ
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: 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:
該当のソースコード
Gemfile
gem 'mysql2' 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] end group :development do # Access an interactive console on exception pages or by calling '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 group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end
database.yml
default: &default adapter: mysql2 encoding: utf8 reconnect: false pool: 5 timeout: 5000 username: katsu password: socket: /tmp/mysql.sock # host: localhost development: adapter: mysql2 encoding: utf8 reconnect: false database: dating_development pool: 5 username: katsu password: # host: localhost test: adapter: mysql2 encoding: utf8 reconnect: false database: dating_test pool: 5 username: katsu password: # host: localhost production: adapter: mysql2 encoding: utf8 reconnect: false database: heroku_442940a47d4fa8b pool: 5 username: bd390abe2264a8 password: <%= ENV['DB_PASSWORD'] %> host: http://us-cdbr-iron-east-03.cleardb.net
試したこと
エラー内容にあるhttps~以下の方法も試しました。
初めはデータベースがsqlite3の状態でデプロイしたら同じエラーが出て、Mysqlに変えてGemfileからsqlite3を削除したのにまだエラー内容がsqlite関連です。
ちなみにエディタでcommand + shift + F をしてproject findでsqlite3を調べたらgitignoreに以下内容があったのですがこれは削除すべきですか?
#Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal
何か解決方法がわかる方がいましたら助けてください。
回答1件
あなたの回答
tips
プレビュー