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

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

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

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

Ruby

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

Q&A

解決済

1回答

275閲覧

AWS Cloud9でHerokuにデプロイをすることができない

退会済みユーザー

退会済みユーザー

総合スコア0

Ruby on Rails 5

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

Ruby

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

0グッド

0クリップ

投稿2019/02/04 11:16

前提・実現したいこと

Rails Tutorial第1章の項目1.5デプロイするにおいて
hello,world!をデプロイしたいです。

発生している問題・エラーメッセージ

hello,world!と表示したいのですが下の画像が表示されてしまいます。

イメージ説明

エラーメッセージ git push heroku masterを実行した際に以下のエラーが発生します。 ~/environment/hello_app (master) $ git push heroku master Counting objects: 101, done. Compressing objects: 100% (85/85), done. Writing objects: 100% (101/101), 24.57 KiB | 1.44 MiB/s, done. Total 101 (delta 4), 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: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.5.3 remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: You are trying to install in deployment mode after changing remote: your Gemfile. Run `bundle install` elsewhere and add the remote: updated Gemfile.lock to version control. remote: remote: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * rails (= 5.1.6) remote: * puma (= 3.9.1) remote: * sass-rails (= 5.0.6) remote: * uglifier (= 3.2.0) remote: * coffee-rails (= 4.2.2) remote: * jquery-rails (= 4.3.1) remote: * turbolinks (= 5.0.1) remote: * jbuilder (= 2.6.4) remote: * sqlite3 (= 1.3.13) remote: * byebug (= 9.0.6) remote: * web-console (= 3.5.1) remote: * listen (= 3.1.5) remote: * spring (= 2.0.2) remote: * spring-watcher-listen (= 2.0.1) remote: remote: You have deleted from the Gemfile: remote: * byebug remote: * capybara (~> 2.13) remote: * coffee-rails (~> 4.2) remote: * jbuilder (~> 2.5) remote: * listen (< 3.2, >= 3.0.5) remote: * puma (~> 3.7) remote: * rails (~> 5.1.6) remote: * sass-rails (~> 5.0) remote: * selenium-webdriver remote: * spring remote: * spring-watcher-listen (~> 2.0.0) remote: * sqlite3 remote: * turbolinks (~> 5) remote: * uglifier (>= 1.3.0) remote: * web-console (>= 3.3.0) remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. remote: You are trying to install in deployment mode after changing remote: your Gemfile. Run `bundle install` elsewhere and add the remote: updated Gemfile.lock to version control. remote: remote: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * rails (= 5.1.6) remote: * puma (= 3.9.1) remote: * sass-rails (= 5.0.6) remote: * uglifier (= 3.2.0) remote: * coffee-rails (= 4.2.2) remote: * jquery-rails (= 4.3.1) remote: * turbolinks (= 5.0.1) remote: * jbuilder (= 2.6.4) remote: * sqlite3 (= 1.3.13) remote: * byebug (= 9.0.6) remote: * web-console (= 3.5.1) remote: * listen (= 3.1.5) remote: * spring (= 2.0.2) remote: * spring-watcher-listen (= 2.0.1) remote: remote: You have deleted from the Gemfile: remote: * byebug remote: * capybara (~> 2.13) remote: * coffee-rails (~> 4.2) remote: * jbuilder (~> 2.5) remote: * listen (< 3.2, >= 3.0.5) remote: * puma (~> 3.7) remote: * rails (~> 5.1.6) remote: * sass-rails (~> 5.0) remote: * selenium-webdriver remote: * spring remote: * spring-watcher-listen (~> 2.0.0) remote: * sqlite3 remote: * turbolinks (~> 5) remote: * uglifier (>= 1.3.0) remote: * web-console (>= 3.3.0) 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 whispering-meadow-74714. remote: To https://git.heroku.com/whispering-meadow-74714remote: remote: ! Push rejected to whispering-meadow-74714. remote: To https://git.heroku.com/whispering-meadow-74714.git git ! [remote rejected] master -> master (pre-receive hook declined)error: failed to push some refs to 'https://git.heroku.com/whisperi

試したこと

teratailに掲載されている
Cloud9を利用したHerokuへのデプロイができない
を参考にしたのですが記事にて指摘されているGemfileの修正もtutorial通りに行なっているためどこを修正すれば良いのか検討がついてない状態におります。
※gemfileの内容は以下の通りです。

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]

ここに問題に対して試したことを記載してください。

補足情報(FW/ツールのバージョンなど)

railsのバージョンは5.16です。
環境はAWSのCloud9を使用しております。

経験豊富な会員の皆さま
まだ始めて間もない初心者ですが
どうかご指導のほどよろしくお願いいたします。

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

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

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

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

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

guest

回答1

0

ベストアンサー

現在まだ開発中ということであれば以下をお試しください。

  1. Gemfile.lockファイルを削除
  2. 以下コマンドを実行
    $ bundle install
  3. git add・commit 及びHerokuにpush

Gemfileの依存性が問題であると思います。

投稿2019/03/12 10:48

ykp_yk

総合スコア654

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問