前提・実現したいこと
Railsチュートリアルの第2章をやっています。
Railstutorial
1git commit -am "Add hello" 2heroku create 3git push && git push heroku master
git pushは成功したのですが、 git push heroku master が失敗してしまいます。
発生している問題・エラーメッセージ
下記のエラーメッセージの最後の方のPush rejected to ancient-tundra-71374.がエラー箇所です。
terminallog
1ubuntu:~/environment/toy_app (master) $ git push && git push heroku master 2Everything up-to-date 3Counting objects: 117, done. 4Compressing objects: 100% (99/99), done. 5Writing objects: 100% (117/117), 27.26 KiB | 1.14 MiB/s, done. 6Total 117 (delta 12), reused 0 (delta 0) 7remote: Compressing source files... done. 8remote: Building source: 9remote: 10remote: -----> Building on the Heroku-20 stack 11remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. 12remote: Detected buildpacks: Ruby,Node.js 13remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order 14remote: -----> Ruby app detected 15remote: -----> Installing bundler 1.17.3 16remote: -----> Removing BUNDLED WITH version in the Gemfile.lock 17remote: -----> Compiling Ruby/Rails 18remote: -----> Using Ruby version: ruby-2.6.6 19remote: -----> Installing dependencies using bundler 1.17.3 20remote: 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 21remote: 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`. 22remote: Fetching gem metadata from https://rubygems.org/............ 23remote: Fetching https://github.com/rails/webpacker.git 24remote: Fetching rake 12.3.3 25remote: Installing rake 12.3.3 26remote: Fetching concurrent-ruby 1.1.8 27 ・・・(中略)・・・ 28remote: Installing actionmailbox 6.0.3 29remote: Fetching actiontext 6.0.3 30remote: Installing actiontext 6.0.3 31remote: Using webpacker 6.0.0.beta.4 from https://github.com/rails/webpacker.git (at master@f40fa08) 32remote: Fetching sass-rails 5.1.0 33remote: Installing sass-rails 5.1.0 34remote: Fetching rails 6.0.3 35remote: Installing rails 6.0.3 36remote: Bundle complete! 18 Gemfile dependencies, 61 gems now installed. 37remote: Gems in the groups development and test were not installed. 38remote: Bundled gems are installed into `./vendor/bundle` 39remote: Post-install message from i18n: 40remote: 41remote: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. 42remote: But that may break your application. 43remote: 44remote: If you are upgrading your Rails application from an older version of Rails: 45remote: 46remote: Please check your Rails app for 'config.i18n.fallbacks = true'. 47remote: If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be 48remote: 'config.i18n.fallbacks = [I18n.default_locale]'. 49remote: If not, fallbacks will be broken in your app by I18n 1.1.x. 50remote: 51remote: If you are starting a NEW Rails application, you can ignore this notice. 52remote: 53remote: For more info see: 54remote: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 55remote: 56remote: Post-install message from sass: 57remote: 58remote: Ruby Sass has reached end-of-life and should no longer be used. 59remote: 60remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new 61remote: primary implementation: https://sass-lang.com/install 62remote: 63remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the 64remote: sassc gem: https://github.com/sass/sassc-ruby#readme 65remote: 66remote: * For more details, please refer to the Sass blog: 67remote: https://sass-lang.com/blog/posts/7828841 68remote: 69remote: Bundle completed (37.47s) 70remote: Cleaning up the bundler cache. 71remote: -----> Installing node-v12.16.2-linux-x64 72remote: -----> Installing yarn-v1.22.4 73remote: -----> Detecting rake tasks 74remote: -----> Preparing app for Rails asset pipeline 75remote: Running: rake assets:precompile 76remote: yarn install v1.22.4 77remote: info No lockfile found. 78remote: [1/4] Resolving packages... 79remote: [2/4] Fetching packages... 80remote: [3/4] Linking dependencies... 81remote: [4/4] Building fresh packages... 82remote: Done in 0.63s. 83remote: I, [2021-01-24T04:20:25.605373 #1108] INFO -- : Writing /tmp/build_4329fc4d/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css 84remote: I, [2021-01-24T04:20:25.606259 #1108] INFO -- : Writing /tmp/build_4329fc4d/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz 85remote: Compiling... 86remote: Compilation failed: 87remote: yarn run v1.22.4 88remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 89remote: 90remote: 91remote: error Command "webpack" not found. 92remote: 93remote: 94remote: ! 95remote: ! Precompiling assets failed. 96remote: ! 97remote: ! Push rejected, failed to compile Ruby app. 98remote: 99remote: ! Push failed 100remote: Verifying deploy... 101remote: 102remote: ! Push rejected to peaceful-wave-59304. 103remote: 104To https://git.heroku.com/peaceful-wave-59304.git 105 ! [remote rejected] master -> master (pre-receive hook declined) 106error: failed to push some refs to 'https://git.heroku.com/peaceful-wave-59304.git'
試したこと
-
gitとHerokuにはログイン済みです。
-
Herokuのpush先のレポジトリもheroku createで作成済みです
terminallog
1 ubuntu:~/environment/toy_app (master) $ git remote -v 2heroku https://git.heroku.com/peaceful-wave-59304.git (fetch) 3heroku https://git.heroku.com/peaceful-wave-59304.git (push) 4 origin git@github.com:●●●●●●/toy_app.git (fetch) 5 origin git@github.com:●●●●●●/toy_app.git (push) 6 7 ※●はアカウント名なので伏字に
- 似たような質問があったのでyarn runをしたが効果なし。
terminallog
1ubuntu:~/environment/toy_app (master) $ yarn -v 21.22.5 3ubuntu:~/environment/toy_app (master) $ yarn run 4yarn run v1.22.5 5error There are no binary scripts available. 6error There are no scripts specified inside package.json. 7Done in 0.05s. 8
- sudo apt install webpack でWebpackをインストールしなおしましたが結果は変わりませんでした。
補足情報(FW/ツールのバージョンなど)
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4gem 'rails', '6.0.3' 5gem 'puma', '4.3.6' 6gem 'sass-rails', '5.1.0' 7gem 'webpacker', '4.0.7' 8# gem "webpacker", github: "rails/webpacker" 9gem 'turbolinks', '5.2.0' 10gem 'jbuilder', '2.9.1' 11gem 'bootsnap', '1.4.5', require: false 12 13group :development, :test do 14 gem 'sqlite3', '1.4.1' 15 gem 'byebug', '11.0.1', platforms: [:mri, :mingw, :x64_mingw] 16end 17 18group :development do 19 gem 'web-console', '4.0.1' 20 gem 'listen', '3.1.5' 21 gem 'spring', '2.1.0' 22 gem 'spring-watcher-listen', '2.0.1' 23end 24 25group :test do 26 gem 'capybara', '3.28.0' 27 gem 'selenium-webdriver', '3.142.4' 28 gem 'webdrivers', '4.1.2' 29end 30 31group :production do 32 gem 'pg', '1.1.4' 33end 34 35# Windows ではタイムゾーン情報用の tzinfo-data gem を含める必要があります 36gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
あなたの回答
tips
プレビュー