railsアプリのGemfileを下記のように書き換えbundle install --without productionを実行し、heroku createを実行した後gitの操作を行い、git push heroku masterを実行したらエラーが出ました。解決方法がわからず質問させていただきました 。
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.6.8' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' 7gem 'rails', '~> 6.1.4', '>= 6.1.4.1' 8# Use sqlite3 as the database for Active Record 9group :development do 10 gem 'sqlite3', '~> 1.4' 11end 12# Use Puma as the app server 13gem 'puma', '~> 5.0' 14# Use SCSS for stylesheets 15gem 'sass-rails', '>= 6' 16# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 17gem 'webpacker', '~> 5.0' 18# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 19gem 'turbolinks', '~> 5' 20# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 21gem 'jbuilder', '~> 2.7' 22 23gem 'devise' 24group :production do 25 gem 'pg' 26end 27# Use Redis adapter to run Action Cable in production 28# gem 'redis', '~> 4.0' 29# Use Active Model has_secure_password 30# gem 'bcrypt', '~> 3.1.7' 31 32# Use Active Storage variant 33# gem 'image_processing', '~> 1.2' 34 35# Reduces boot times through caching; required in config/boot.rb 36gem 'bootsnap', '>= 1.4.4', require: false 37 38group :development, :test do 39 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 40 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 41end 42 43group :development do 44 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 45 gem 'web-console', '>= 4.1.0' 46 # Display performance information such as SQL time and flame graphs for each request in your browser. 47 # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md 48 gem 'rack-mini-profiler', '~> 2.0' 49 gem 'listen', '~> 3.3' 50 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 51 gem 'spring' 52end 53 54group :test do 55 # Adds support for Capybara system testing and selenium driver 56 gem 'capybara', '>= 3.26' 57 gem 'selenium-webdriver' 58 # Easy installation and use of web drivers to run system tests with browsers 59 gem 'webdrivers' 60end 61 62# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 63gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 64
### エラーメッセージ
remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku: remote: ! https://devcenter.heroku.com/articles/sqlite3
##追加情報
database.ymlのproductionの部分を下記のように変更しました。
database.yml
1# SQLite. Versions 3.8.0 and up are supported. 2# gem install sqlite3 3# 4# Ensure the SQLite 3 gem is defined in your Gemfile 5# gem 'sqlite3' 6# 7default: &default 8 adapter: sqlite3 9 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 timeout: 5000 11 12development: 13 <<: *default 14 database: db/development.sqlite3 15 16# Warning: The database defined as "test" will be erased and 17# re-generated from your development database when you run "rake". 18# Do not set this db to the same as development or production. 19test: 20 <<: *default 21 database: db/test.sqlite3 22 23production: 24 <<: *default 25adapter: postgresql 26encoding: unicode 27pool: 5 28
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。