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

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

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

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

Heroku

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

Ruby on Rails

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

Q&A

解決済

4回答

1692閲覧

herokuデプロイ時のエラーについて

tomiheeee

総合スコア6

Ruby

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

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2018/12/25 05:35

編集2018/12/27 09:19

Webサービスを作成した後herokuにデプロイをしようとすると以下のようなエラーコードが出ます。

remote: You have added to the Gemfile: remote: * pg remote: remote: ! remote: ! Failed to install gems via Bundler. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to tomitanomado. remote: To https://git.heroku.com/tomitanomado.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/tomitanomado.git'

Gemfileに原因があるのかと、色々調べてみたのですがよく分かりません。
以下Gemfileです。

source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.6' # Use sqlite3 as the database for Active Record gem 'sqlite3', group: :development # Use Puma as the app server gem 'puma', '~> 3.7' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' group :production do gem 'pg' end # 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', platforms: [:mri, :mingw, :x64_mingw] # Adds support for Capybara system testing and selenium driver gem 'capybara', '~> 2.13' gem 'selenium-webdriver' end group :development do # Access an IRB console on exception pages or by using <%= 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 # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'bootstrap', '~> 4.1.3' gem 'jquery-rails' gem 'dotenv-rails'

(追記)
Heorku側のAddonも追加されてると思うのですが、Gemfileの読み込みができていません。
イメージ説明

お手数おかけしますが、よろしくお願いいたします。

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

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

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

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

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

kazto

2018/12/25 07:36

Gemfileの内容を追記お願いできますでしょうか。
tomiheeee

2018/12/25 08:03

Gemfileの内容、書いてますが 見れませんか?
kazto

2018/12/25 08:29

失礼しました。見落としました。。。
guest

回答4

0

heroku上でPostgreSQLを使用する場合、addonを追加する必要があるようです。
こちらの対応はいたしましたでしょうか。

https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-heroku-postgres

投稿2018/12/25 08:34

kazto

総合スコア7196

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

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

tomiheeee

2018/12/27 09:20

回答ありがとうございます。 HerokuでのAddonもできてるつもりです。。 Gemfile読み込めない理由、他にありますでしょうか。。
guest

0

解決しました!ありがとうございました

投稿2019/02/27 06:02

tomiheeee

総合スコア6

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

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

0

自己解決

解決しました!ありがとうございました

投稿2019/02/27 05:58

tomiheeee

総合スコア6

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

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

0

調べてみると同様の症状として多いのは
bundle install(もしくはbundle install --without productionを実行せずに
herokuへのpushを行っている場合でした

投稿2018/12/27 10:14

asm

総合スコア15147

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問