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

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

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

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

Ruby on Rails

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

Q&A

1回答

1552閲覧

【Ruby on Railsチュートリアル】git push heroku masterをした際の、Could not detect rake tasks(エラー)について

退会済みユーザー

退会済みユーザー

総合スコア0

Ruby

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

Ruby on Rails

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

0グッド

0クリップ

投稿2019/06/26 05:06

前提・実現したいこと

現在、Railsチュートリアルの2章を進めている初心者です。
2章の序盤にて、git heroku push masterを行うのですが、下記のようなエラーが出てしまいました。
1章のgit heroku push masterが同じ手順で成功したため、2章のエラーが何なのかがわからない状態です。

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

膨大なpush実行文のうち、以下の部分が原因だろうか?と個人的に考えていました。

-----> Ruby app detected -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.5.5 -----> Installing dependencies using bundler 2.0.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. 〜略〜 remote: ! remote: ! Could not detect rake tasks remote: ! ensure you can run `$ bundle exec rake -P` against your app remote: ! and using the production group of your Gemfile. remote: ! Activating bundler (2.0.1) failed: remote: ! Could not find 'bundler' (2.0.1) required by your /tmp/build_ecaa2911b7de7674a34f8dd4c80f6e39/Gemfile.lock. remote: ! To update to the latest version installed on your system, run `bundle update --bundler`. remote: ! To install the missing version, run `gem install bundler:2.0.1` remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information remote: ! remote: ! To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'` remote: ! 〜略〜 ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/mysterious-inlet-51368.git'

試したこと

まず最初の-----> Ruby app detected 以下にある、

$ bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java

を試してみるもののエラーは変わらず、
Could not detect rake tasks以下に記載されている通りに、

$ bundle exec rake -P $ bundle update --bundler $ gem install bundler:2.0.1 $ gem install bundler -v '2.0.1'

などのコマンドを試してからpushしても、同じエラー文が出てくるだけでした。
ただ、 'GEM_PATH=vendor/bundle/ruby/2.5.0'という部分を、$ gem envで確認したところ、

RubyGems Environment: - RUBYGEMS VERSION: 2.7.6 - RUBY VERSION: 2.5.3 (2018-10-18 patchlevel 105) [x86_64-darwin18] - INSTALLATION DIRECTORY: /Users/~/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0 - USER INSTALLATION DIRECTORY: /Users/~/.gem/ruby/2.5.0 - RUBY EXECUTABLE: /Users/~/.rbenv/versions/2.5.3/bin/ruby - EXECUTABLE DIRECTORY: /Users/~/.rbenv/versions/2.5.3/bin - SPEC CACHE DIRECTORY: /Users/~/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /Users/~/.rbenv/versions/2.5.3/etc - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-18 - GEM PATHS: - /Users/~/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0 - /Users/~/.gem/ruby/2.5.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /Users/~/.rbenv/versions/2.5.3/bin - /usr/local/Cellar/rbenv/1.1.1/libexec - /Users/~/.nodebrew/current/bin - /Users/~/.rbenv/shims - /Users/~/.rbenv/shims - /Users/~/.pyenv/shims - /usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin

'GEM_PATH=vendor/bundle/ruby/2.5.0'と同じよう記述がないのが気になっています。
しかし、検索をかけても何をすれば良いかヒットしないため、お手上げ状態です。

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

参考までにGemfileとGemfile.lockを記載いたします。
#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 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', platforms: :mri gem 'capybara', '2.13' gem 'selenium-webdriver' 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 gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

GEM remote: https://rubygems.org/ specs: actioncable (5.1.6) actionpack (= 5.1.6) nio4r (~> 2.0) websocket-driver (~> 0.6.1) actionmailer (5.1.6) actionpack (= 5.1.6) actionview (= 5.1.6) activejob (= 5.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) actionpack (5.1.6) actionview (= 5.1.6) activesupport (= 5.1.6) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (5.1.6) activesupport (= 5.1.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) activejob (5.1.6) activesupport (= 5.1.6) globalid (>= 0.3.6) activemodel (5.1.6) activesupport (= 5.1.6) activerecord (5.1.6) activemodel (= 5.1.6) activesupport (= 5.1.6) arel (~> 8.0) activesupport (5.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.6.0) public_suffix (>= 2.0.2, < 4.0) arel (8.0.0) bindex (0.7.0) builder (3.2.3) byebug (9.0.6) capybara (2.13.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) childprocess (1.0.1) rake (< 13.0) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) concurrent-ruby (1.1.5) crass (1.0.4) erubi (1.8.0) execjs (2.7.0) ffi (1.11.1) globalid (0.4.2) activesupport (>= 4.2.0) i18n (1.6.0) concurrent-ruby (~> 1.0) jbuilder (2.7.0) activesupport (>= 4.2.0) multi_json (>= 1.2) jquery-rails (4.3.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) loofah (2.2.3) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.2) mime-types (3.2.2) mime-types-data (~> 3.2015) mime-types-data (3.2019.0331) mini_mime (1.0.1) mini_portile2 (2.4.0) minitest (5.11.3) multi_json (1.13.1) nio4r (2.3.1) nokogiri (1.10.3) mini_portile2 (~> 2.4.0) pg (0.20.0) public_suffix (3.1.1) puma (3.9.1) rack (2.0.7) rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.1.6) actioncable (= 5.1.6) actionmailer (= 5.1.6) actionpack (= 5.1.6) actionview (= 5.1.6) activejob (= 5.1.6) activemodel (= 5.1.6) activerecord (= 5.1.6) activesupport (= 5.1.6) bundler (>= 1.3.0) railties (= 5.1.6) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) railties (5.1.6) actionpack (= 5.1.6) activesupport (= 5.1.6) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (12.3.2) rb-fsevent (0.10.3) rb-inotify (0.10.0) ffi (~> 1.0) ruby_dep (1.5.0) rubyzip (1.2.3) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) selenium-webdriver (3.142.3) childprocess (>= 0.5, < 2.0) rubyzip (~> 1.2, >= 1.2.2) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.3.13) thor (0.20.3) thread_safe (0.3.6) tilt (2.0.9) turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.2.0) tzinfo (1.2.5) thread_safe (~> 0.1) uglifier (3.2.0) execjs (>= 0.3.0, < 3) web-console (3.5.1) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) xpath (2.1.0) nokogiri (~> 1.3) PLATFORMS ruby DEPENDENCIES byebug (= 9.0.6) capybara (= 2.13) coffee-rails (= 4.2.2) jbuilder (= 2.7.0) jquery-rails (= 4.3.1) listen (= 3.1.5) pg (= 0.20.0) puma (= 3.9.1) rails (= 5.1.6) sass-rails (= 5.0.6) selenium-webdriver spring (= 2.0.2) spring-watcher-listen (= 2.0.1) sqlite3 (= 1.3.13) turbolinks (= 5.0.1) tzinfo-data uglifier (= 3.2.0) web-console (= 3.5.1) BUNDLED WITH 2.0.1

どうぞよろしくお願いします。

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

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

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

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

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

guest

回答1

0

※6/27追記
Herokuへのpushエラーが解決したので、解決方法を載せます。

https://qiita.com/gonzaemon111/items/5aaffab894fa39b02a79
https://qiita.com/wktk/items/1453157e958108ff0939

などのQiitaによる事例から、HerokuがBundler2系に対応してないからか?と思い、Bundlerのバージョンを1系(1.17.3)に落としたところ、git push heroku が可能となりました。
これが真の原因なのか、未だわからないところはありますが、一旦解決いたしました。

投稿2019/06/27 06:01

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問