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

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

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

Yarnは、Facebook/Exponent/Google/Tildeが開発したJavaScriptのパッケージマネージャ。npmよりもインストールが速く、厳密にモジュールのバージョンを固定できるなど、npmの問題を解決。npmと互換性があり、同じpackage.jsonを使用できます。

Ruby on Rails 6

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

Heroku

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

Q&A

0回答

674閲覧

Cloud9からHerokuへデプロイしたいです

soiyaman

総合スコア0

Yarn

Yarnは、Facebook/Exponent/Google/Tildeが開発したJavaScriptのパッケージマネージャ。npmよりもインストールが速く、厳密にモジュールのバージョンを固定できるなど、npmの問題を解決。npmと互換性があり、同じpackage.jsonを使用できます。

Ruby on Rails 6

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

Heroku

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

0グッド

0クリップ

投稿2021/11/03 03:16

前提・実現したいこと

初学者です。railsを勉強中です。
cloud9からherokuにデプロイできている状態を実現したいです。
ご回答いただけますと幸いです。

web業界のお作法がまだ、あまり土地勘がなく
不足点ございましたら、ご指摘いただけますと幸いです。

※補足※
Railsチュートリアルで第1章をやっており、最後のherokuでデプロイする場所で
詰みました。ネット上にあるものはいろいろ拝見して試しましたが解決できませんでした。

■■な機能を実装中に以下のエラーメッセージが発生しました。

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

ubuntu:~/environment/hello_app (master) $ git push heroku master Counting objects: 110, done. Compressing objects: 100% (92/92), done. Writing objects: 100% (110/110), 26.81 KiB | 1.17 MiB/s, done. Total 110 (delta 7), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Determining which buildpack to use for this app 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 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.7.4 remote: -----> Installing dependencies using bundler 1.17.3 remote: 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 remote: 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: Fetching gem metadata from https://rubygems.org/............ . . . remote: Fetching webpacker 4.0.7 remote: Installing sass-rails 5.1.0 remote: Installing rails 6.0.3 remote: Installing webpacker 4.0.7 remote: Bundle complete! 18 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 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: Removing bundler (1.17.3) remote: Bundle completed (35.71s) 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: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: yarn install v1.22.4 remote: info No lockfile found. remote: [1/4] Resolving packages... remote: warning webpack-dev-server > sockjs > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. remote: warning webpack-dev-server > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. remote: [2/4] Fetching packages... remote: info fsevents@2.3.2: The platform "linux" is incompatible with this module. remote: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. remote: [3/4] Linking dependencies... remote: warning " > webpack-dev-server@4.4.0" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0". remote: warning "webpack-dev-server > webpack-dev-middleware@5.2.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". remote: [4/4] Building fresh packages... remote: Done in 6.78s. remote: I, [2021-11-02T08:56:42.766727 #1080] INFO -- : Writing /tmp/build_390456f0/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css remote: I, [2021-11-02T08:56:42.767226 #1080] INFO -- : Writing /tmp/build_390456f0/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css.gz remote: Compiling… remote: Compilation failed: remote: error Command "webpack" not found. remote: remote: yarn run v1.22.4 remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. remote: remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to frozen-sands-92281. remote: To https://git.heroku.com/frozen-sands-92281.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/frozen-sands-92281.git' ubuntu:~/environment/hello_app (master) $

該当のソースコード

#package.jsonの中身です { "name": "hello_app", "license": "UNLICENSED", "private": true, "dependencies": { "@rails/actioncable": "^6.0.0", "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "^5.4.3", "turbolinks": "^5.2.0", "yarn": "^1.22.17" }, "version": "0.1.0", "devDependencies": { "webpack-dev-server": "^4.4.0" }, "description": "The best package you will ever find.", "main": "index.js", "repository": "https://github.com//hello_app.git", "author": "Yarn Contributor" }

試したこと

①yarnからwebpackerを削除 [参照]https://www.somethinggood.work/151
→しかし、下記の通りpackage.jsonの影響でエラーになります。
warning ../../package.json: No license field
[1/2] Removing module webpack...
error This module isn't specified in a package.json file.

②package.jsonでlicense fieldを追記して、再度①を実行 [参照]https://qiita.com/kozakura16/items/ebaf8ea58fc49dcbdd73
→再度、①と同様のエラーが出ます
warning ../../package.json: No license field
[1/2] Removing module webpack...
error This module isn't specified in a package.json file.

③yarnを再インストール[参照]
→やはり、package.jsonが悪さをしてそう&linuxもうまくいってなさそう
ubuntu:~/environment/hello_app (master) $ yarn install --check-files
yarn install v1.22.15
warning ../../package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > webpack-dev-server@4.4.0" has unmet peer dependency "webpack@^4.37.0 || ^5.0.0".
warning "webpack-dev-server > webpack-dev-middleware@5.2.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
[4/4] Building fresh packages...
Done in 5.96s.
※再度、①をやっても同様のエラー発生

④Gihub/Herokuの再起動後に、再度デプロイ挑戦するも同様のエラー

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

mac OS MOjave バージョン10.14.6
ruby 2.6.3 (Railsチュートリアルより指定あり)
Rails 6.0.3
yarn 1.22.15

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問