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

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

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

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

Heroku

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

Q&A

解決済

1回答

1430閲覧

herokuにpushできない

yyyy256

総合スコア11

Ruby on Rails 6

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

Heroku

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

0グッド

0クリップ

投稿2022/03/08 06:37

rails チュートリアル第1章にてherokuへpushしようとしたところ失敗しました。

TypeErrorで検索してみても、よくわからず止まってしまいました。

Build log

-----> Building on the Heroku-20 stack -----> Determining which buildpack to use for this app ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. Detected buildpacks: Ruby,Node.js See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order -----> Ruby app detected -----> Installing bundler 1.17.3 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-3.0.3 -----> Installing dependencies using bundler 1.17.3 Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4 (文字数制限により省略) Bundle complete! 18 Gemfile dependencies, 58 gems now installed. Gems in the groups 'development' and 'test' were not installed. Bundled gems are installed into `./vendor/bundle` Post-install message from sass: Ruby Sass has reached end-of-life and should no longer be used. * If you use Sass as a command-line tool, we recommend using Dart Sass, the new primary implementation: https://sass-lang.com/install * If you use Sass as a plug-in for a Ruby web framework, we recommend using the sassc gem: https://github.com/sass/sassc-ruby#readme * For more details, please refer to the Sass blog: https://sass-lang.com/blog/posts/7828841 Bundle completed (23.91s) Cleaning up the bundler cache. -----> Installing node-v16.13.1-linux-x64 -----> Installing yarn-v1.22.17 -----> Detecting rake tasks ! ! Could not detect rake tasks ! ensure you can run `$ bundle exec rake -P` against your app ! and using the production group of your Gemfile. ! rake aborted! ! TypeError: wrong argument type false (expected Symbol) ! /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:12:in `to_binary' ! /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:12:in `input_to_storage' ! /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in `fetch' ! /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in `load_iseq' ! /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' (省略) ! /tmp/build_a51a0b6f/bin/rake:5:in `<main>' ! ! Caused by: ! Bootsnap::LoadPathCache::FallbackScan: ! /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:100:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError) ensure you can run `$ bundle exec rake -P` against your app and using the production group of your Gemfile. rake aborted! TypeError: wrong argument type false (expected Symbol) /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:12:in `to_binary' /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:12:in `input_to_storage' /tmp/build_a51a0b6f/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in `fetch' (省略) Caused by: Bootsnap::LoadPathCache::FallbackScan: (文字数制限により省略) ! Push rejected, failed to compile Ruby app. ! Push failed

log

1 ! Could not detect rake tasks 2 ! ensure you can run `$ bundle exec rake -P` against your app 3 ! and using the production group of your Gemfile. 4 ! rake aborted! 5 ! TypeError: wrong argument type false (expected Symbol)

このあたりが怪しそうなのはなんとなく分かるのですが、これの原因と対処法が調べても分かりませんでした。

Rubyが3.0.3を実行してしまっていることが原因なのでしょうか?
.ruby-versionで2.6.8を指定しているのですが・・・

試したこと

  • Gemfile.lock をリセットしてbundle installを実行
  • bundle exec rake -Pを実行しもう一度push

環境

WSL2 (Ubuntu 20.04.4)
Ruby 2.6.8
Ruby on Rails 6.1.4.1

ご教授いただければ幸いです。

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

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

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

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

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

guest

回答1

0

ベストアンサー

下記の記事と同じエラーかと思いますので、参考にしてみてください。

herokuデプロイでエラー Could not detect rake tasks
https://qiita.com/hellhellmymy/items/a32f53ba38f843a8f916

また、Heroku で使える Ruby のバージョンはかなり限定されており、バージョン 2.6.8 はサポートされていません。
使用可能なバージョンは、公式サイトで確認してください。

Heroku > Ruby のバージョン
https://devcenter.heroku.com/ja/articles/ruby-support#ruby-versions

投稿2022/03/08 22:44

nskydiving

総合スコア6500

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

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

yyyy256

2022/03/09 02:41

ありがとうございます! おっしゃるとおりでした。 commitすることを忘れていたこととrubyのバージョンが合っていなかったことが原因でした。 rbenvをアップデートし、対応したrubyのバージョンを適応することで無事にデプロイすることができました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.47%

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

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

質問する

関連した質問