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

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

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

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

Ruby on Rails 6

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

Heroku

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

Ruby on Rails

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

Q&A

0回答

1109閲覧

ローカル環境にてrails tutorial中herokuデプロイ中二Could not detect rake tasks とエラー発生。

yama_diary

総合スコア1

Ruby

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

Ruby on Rails 6

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

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2021/01/11 14:50

##前提と目的
ローカル環境にてrails tutorial中herokuにデプロイ中に下記のエラーが発生。

Could not detect rake tasks ensure you can run `$ bundle exec rake -P` against your app and using the production group of your Gemfile.

下記にデプロイ中の様子で正常だと思ったとこ以外を記載。(長くてすいません。)

toy_app % git push && git push heroku Enumerating objects: 13, done. Counting objects: 100% (13/13), done. Delta compression using up to 8 threads Compressing objects: 100% (7/7), done. Writing objects: 100% (7/7), 665 bytes | 665.00 KiB/s, done. Total 7 (delta 4), reused 0 (delta 0) remote: Resolving deltas: 100% (4/4), completed with 4 local objects. To https://github.com/yamamoto-try/toy_app.git d43d084..e110c03 master -> master Enumerating objects: 111, done. Counting objects: 100% (111/111), done. Delta compression using up to 8 threads Compressing objects: 100% (93/93), done. Writing objects: 100% (111/111), 149.44 KiB | 4.39 MiB/s, done. Total 111 (delta 7), 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: -----> Installing bundler 2.1.4 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.6.6 remote: -----> Installing dependencies using bundler 2.1.4 remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 remote: The dependency byebug (= 11.0.1) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86_64-darwin-19 but the dependency is only for ruby, x86-mingw32, x64-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform ruby x86-mingw32 x64-mingw32`. remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86_64-darwin-19 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: Fetching gem metadata from https://rubygems.org/............ remote: Bundle complete! 19 Gemfile dependencies, 60 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into `./vendor/bundle` remote: Post-install message from i18n: remote: remote: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. remote: But that may break your application. remote: remote: If you are upgrading your Rails application from an older version of Rails: remote: remote: Please check your Rails app for 'config.i18n.fallbacks = true'. remote: If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be remote: 'config.i18n.fallbacks = [I18n.default_locale]'. remote: If not, fallbacks will be broken in your app by I18n 1.1.x. remote: remote: If you are starting a NEW Rails application, you can ignore this notice. remote: remote: For more info see: remote: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 remote: remote: Post-install message from sass: remote: remote: Ruby Sass has reached end-of-life and should no longer be used. remote: remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new remote: primary implementation: https://sass-lang.com/install remote: remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the remote: sassc gem: https://github.com/sass/sassc-ruby#readme remote: remote: * For more details, please refer to the Sass blog: remote: https://sass-lang.com/blog/posts/7828841 remote: remote: Bundle completed (198.19s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v12.16.2-linux-x64 remote: -----> Installing yarn-v1.22.4 remote: -----> Detecting rake tasks remote: 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: ! /tmp/build_1f271435/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError) remote: ! from /tmp/build_1f271435/config/boot.rb:4:in `<top (required)>' remote: ! from /tmp/build_1f271435/bin/rake:7:in `require_relative' remote: ! from /tmp/build_1f271435/bin/rake:7:in `<main>' remote: ! remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError) remote: ensure you can run `$ bundle exec rake -P` against your app remote: and using the production group of your Gemfile. remote: /tmp/build_1f271435/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError) remote: from /tmp/build_1f271435/config/boot.rb:4:in `<top (required)>' remote: from /tmp/build_1f271435/bin/rake:7:in `require_relative' remote: from /tmp/build_1f271435/bin/rake:7:in `<main>' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1106:in `rake' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:78:in `block (2 levels) in run_assets_precompile_rake_task' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:190:in `log' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:72:in `block in run_assets_precompile_rake_task' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:40:in `yield_with_block_depth' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:17:in `block in instrument' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/vendor/ruby/heroku-18/lib/ruby/2.6.0/benchmark.rb:308:in `realtime' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/instrument.rb:16:in `instrument' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:50:in `instrument' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:46:in `instrument' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:71:in `run_assets_precompile_rake_task' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:116:in `block (2 levels) in compile' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1127:in `allow_git' remote: from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:15:in `<main>' remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to ancient-cove-47762. remote: To https://git.heroku.com/ancient-cove-47762.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/ancient-cove-47762.git' toy_app % gem install sassc

gemfile.rb は以下

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rails', '6.0.3' gem 'puma', '4.3.6' gem 'sass-rails', '5.1.0' gem 'webpacker', '4.0.7' gem 'turbolinks', '5.2.0' gem 'jbuilder', '2.9.1' gem 'bootsnap', '1.4.5', require: false gem 'sassc' group :development, :test do gem 'sqlite3', '1.4.1' gem 'byebug', '11.0.1', platforms: [:mri, :mingw, :x64_mingw] end group :development do gem 'web-console', '4.0.1' gem 'listen', '3.1.5' gem 'spring', '2.1.0' gem 'spring-watcher-listen', '2.0.1' end group :test do gem 'capybara', '3.28.0' gem 'selenium-webdriver', '3.142.4' gem 'webdrivers', '4.1.2' end group :production do gem 'pg', '1.1.4' end # Windows ではタイムゾーン情報用の tzinfo-data gem を含める必要があります gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

とりあえずエラー文に言われた通り実行。

toy_app % bundle exec rake -P

その後git commitしてpushしてデプロイしたが、最初と全く同じエラー文が表示された。

AWS cloud9ではできたのだが、ローカルではできず、デプロイ中のlogの違いは今回取り上げた部分のみだと思うのだが、、、
わかる方いらっしゃいましたら、ご教授をお願いしたいです。
よろしくお願いいたします。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問