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

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

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

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

Heroku

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

SQLite

SQLiteはリレーショナルデータベース管理システムの1つで、サーバーではなくライブラリとして使用されている。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

852閲覧

【Heroku】git push heroku mainをするとエラーが出る

退会済みユーザー

退会済みユーザー

総合スコア0

Git

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

Heroku

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

SQLite

SQLiteはリレーショナルデータベース管理システムの1つで、サーバーではなくライブラリとして使用されている。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2021/09/08 12:12

編集2021/09/08 12:14

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

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

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

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

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

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

guest

回答1

0

ベストアンサー

インデントが崩れてます。
YAMLはインデントで階層を表現します。

yaml

1production: 2 <<: *default 3 adapter: postgresql 4 encoding: unicode 5 pool: 5

投稿2021/09/08 13:25

neko_daisuki

総合スコア2090

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.45%

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

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

質問する

関連した質問