snyt45 / perfect-rails2

ruby 2.6.6, Rails 6.0.3 2章~
1 stars 0 forks source link

パーフェクトRuby on Rails 第2章のメモ #1

Closed snyt45 closed 3 years ago

snyt45 commented 3 years ago

https://gihyo.jp/book/2020/978-4-297-11462-6/support

snyt45 commented 3 years ago

1章のissueを参考にDockerfile等を準備 ※yarnやsqlite3の対応をした状態を持ってくる

snyt45 commented 3 years ago

プロジェクトのひな形作成 docker-compose run web rails new . --force --skip-bundle

実行ログ
``` Creating network "perfect-rails2_default" with the default driver Creating volume "perfect-rails2_bundle_data" with default driver Building web Step 1/10 : FROM ruby:2.6.6 ---> 6d86b0beade7 Step 2/10 : RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list ---> Running in a1c0803201de Warning: apt-key output should not be parsed (stdout is not a terminal) OK deb https://dl.yarnpkg.com/debian/ stable main Removing intermediate container a1c0803201de ---> 9e80f4365711 Step 3/10 : RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs imagemagick yarn sqlite3 ---> Running in deafbfe1557c Reading package lists... Building dependency tree... Reading state information... imagemagick is already the newest version (8:6.9.10.23+dfsg-2.1+deb10u1). The following additional packages will be installed: libbrotli1 libc-ares2 libnode64 libpq5 libuv1 nodejs-doc Suggested packages: postgresql-doc-11 npm sqlite3-doc The following NEW packages will be installed: build-essential libbrotli1 libc-ares2 libnode64 libuv1 nodejs nodejs-doc sqlite3 yarn The following packages will be upgraded: libpq-dev libpq5 2 upgraded, 9 newly installed, 0 to remove and 38 not upgraded. Need to get 9331 kB of archives. After this operation, 39.9 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian buster/main amd64 build-essential amd64 12.6 [7576 B] Get:2 http://security.debian.org/debian-security buster/updates/main amd64 libuv1 amd64 1.24.1-1+deb10u1 [110 kB] Get:3 http://deb.debian.org/debian buster/main amd64 libbrotli1 amd64 1.0.7-2+deb10u1 [269 kB] Get:4 http://deb.debian.org/debian buster/main amd64 libc-ares2 amd64 1.14.0-1 [85.8 kB] Get:5 http://deb.debian.org/debian buster/main amd64 libnode64 amd64 10.24.0~dfsg-1~deb10u1 [5631 kB] Get:6 https://dl.yarnpkg.com/debian stable/main amd64 yarn all 1.22.5-1 [891 kB] Get:7 http://deb.debian.org/debian buster/main amd64 libpq-dev amd64 11.12-0+deb10u1 [166 kB] Get:8 http://deb.debian.org/debian buster/main amd64 libpq5 amd64 11.12-0+deb10u1 [170 kB] Get:9 http://deb.debian.org/debian buster/main amd64 nodejs amd64 10.24.0~dfsg-1~deb10u1 [87.3 kB] Get:10 http://deb.debian.org/debian buster/main amd64 nodejs-doc all 10.24.0~dfsg-1~deb10u1 [974 kB] Get:11 http://deb.debian.org/debian buster/main amd64 sqlite3 amd64 3.27.2-3+deb10u1 [940 kB] debconf: delaying package configuration, since apt-utils is not installed Fetched 9331 kB in 2s (4135 kB/s) Selecting previously unselected package build-essential. (Reading database ... 23985 files and directories currently installed.) Preparing to unpack .../00-build-essential_12.6_amd64.deb ... Unpacking build-essential (12.6) ... Selecting previously unselected package libbrotli1:amd64. Preparing to unpack .../01-libbrotli1_1.0.7-2+deb10u1_amd64.deb ... Unpacking libbrotli1:amd64 (1.0.7-2+deb10u1) ... Selecting previously unselected package libc-ares2:amd64. Preparing to unpack .../02-libc-ares2_1.14.0-1_amd64.deb ... Unpacking libc-ares2:amd64 (1.14.0-1) ... Selecting previously unselected package libuv1:amd64. Preparing to unpack .../03-libuv1_1.24.1-1+deb10u1_amd64.deb ... Unpacking libuv1:amd64 (1.24.1-1+deb10u1) ... Selecting previously unselected package libnode64:amd64. Preparing to unpack .../04-libnode64_10.24.0~dfsg-1~deb10u1_amd64.deb ... Unpacking libnode64:amd64 (10.24.0~dfsg-1~deb10u1) ... Preparing to unpack .../05-libpq-dev_11.12-0+deb10u1_amd64.deb ... Unpacking libpq-dev (11.12-0+deb10u1) over (11.11-0+deb10u1) ... Preparing to unpack .../06-libpq5_11.12-0+deb10u1_amd64.deb ... Unpacking libpq5:amd64 (11.12-0+deb10u1) over (11.11-0+deb10u1) ... Selecting previously unselected package nodejs. Preparing to unpack .../07-nodejs_10.24.0~dfsg-1~deb10u1_amd64.deb ... Unpacking nodejs (10.24.0~dfsg-1~deb10u1) ... Selecting previously unselected package nodejs-doc. Preparing to unpack .../08-nodejs-doc_10.24.0~dfsg-1~deb10u1_all.deb ... Unpacking nodejs-doc (10.24.0~dfsg-1~deb10u1) ... Selecting previously unselected package sqlite3. Preparing to unpack .../09-sqlite3_3.27.2-3+deb10u1_amd64.deb ... Unpacking sqlite3 (3.27.2-3+deb10u1) ... Selecting previously unselected package yarn. Preparing to unpack .../10-yarn_1.22.5-1_all.deb ... Unpacking yarn (1.22.5-1) ... Setting up libbrotli1:amd64 (1.0.7-2+deb10u1) ... Setting up libpq5:amd64 (11.12-0+deb10u1) ... Setting up libpq-dev (11.12-0+deb10u1) ... Setting up libc-ares2:amd64 (1.14.0-1) ... Setting up libuv1:amd64 (1.24.1-1+deb10u1) ... Setting up libnode64:amd64 (10.24.0~dfsg-1~deb10u1) ... Setting up nodejs-doc (10.24.0~dfsg-1~deb10u1) ... Setting up build-essential (12.6) ... Setting up yarn (1.22.5-1) ... Setting up sqlite3 (3.27.2-3+deb10u1) ... Setting up nodejs (10.24.0~dfsg-1~deb10u1) ... update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Processing triggers for libc-bin (2.28-10) ... Removing intermediate container deafbfe1557c ---> e608513ca8d4 Step 4/10 : RUN mkdir /app ---> Running in a8e3acbda3c5 Removing intermediate container a8e3acbda3c5 ---> 29d3333937be Step 5/10 : ENV APP_ROOT /app ---> Running in 8552e524a84a Removing intermediate container 8552e524a84a ---> c0cea18975a2 Step 6/10 : WORKDIR $APP_ROOT ---> Running in a6b16da529cc Removing intermediate container a6b16da529cc ---> db2f9e075198 Step 7/10 : COPY ./Gemfile $APP_ROOT/Gemfile ---> 62a73a3549ed Step 8/10 : COPY ./Gemfile.lock $APP_ROOT/Gemfile.lock ---> b8eabac5bd48 Step 9/10 : RUN bundle install ---> Running in 4cb172198c08 Fetching gem metadata from https://rubygems.org/............. Fetching gem metadata from https://rubygems.org/. Resolving dependencies... Fetching rake 13.0.6 Installing rake 13.0.6 Fetching concurrent-ruby 1.1.9 Installing concurrent-ruby 1.1.9 Fetching i18n 1.8.10 Installing i18n 1.8.10 Fetching minitest 5.14.4 Installing minitest 5.14.4 Fetching thread_safe 0.3.6 Installing thread_safe 0.3.6 Fetching tzinfo 1.2.9 Installing tzinfo 1.2.9 Fetching zeitwerk 2.4.2 Installing zeitwerk 2.4.2 Fetching activesupport 6.0.3 Installing activesupport 6.0.3 Fetching builder 3.2.4 Installing builder 3.2.4 Fetching erubi 1.10.0 Installing erubi 1.10.0 Fetching mini_portile2 2.5.3 Installing mini_portile2 2.5.3 Fetching racc 1.5.2 Installing racc 1.5.2 with native extensions Fetching nokogiri 1.11.7 (x86_64-linux) Installing nokogiri 1.11.7 (x86_64-linux) Fetching rails-dom-testing 2.0.3 Installing rails-dom-testing 2.0.3 Fetching crass 1.0.6 Installing crass 1.0.6 Fetching loofah 2.10.0 Installing loofah 2.10.0 Fetching rails-html-sanitizer 1.3.0 Installing rails-html-sanitizer 1.3.0 Fetching actionview 6.0.3 Installing actionview 6.0.3 Fetching rack 2.2.3 Installing rack 2.2.3 Fetching rack-test 1.1.0 Installing rack-test 1.1.0 Fetching actionpack 6.0.3 Installing actionpack 6.0.3 Fetching nio4r 2.5.7 Installing nio4r 2.5.7 with native extensions Fetching websocket-extensions 0.1.5 Installing websocket-extensions 0.1.5 Fetching websocket-driver 0.7.5 Installing websocket-driver 0.7.5 with native extensions Fetching actioncable 6.0.3 Installing actioncable 6.0.3 Fetching globalid 0.4.2 Installing globalid 0.4.2 Fetching activejob 6.0.3 Installing activejob 6.0.3 Fetching activemodel 6.0.3 Installing activemodel 6.0.3 Fetching activerecord 6.0.3 Installing activerecord 6.0.3 Fetching mimemagic 0.3.10 Installing mimemagic 0.3.10 with native extensions Fetching marcel 0.3.3 Installing marcel 0.3.3 Fetching activestorage 6.0.3 Installing activestorage 6.0.3 Fetching mini_mime 1.1.0 Installing mini_mime 1.1.0 Fetching mail 2.7.1 Installing mail 2.7.1 Fetching actionmailbox 6.0.3 Installing actionmailbox 6.0.3 Fetching actionmailer 6.0.3 Installing actionmailer 6.0.3 Fetching actiontext 6.0.3 Installing actiontext 6.0.3 Using bundler 1.17.2 Fetching method_source 1.0.0 Installing method_source 1.0.0 Fetching thor 1.1.0 Installing thor 1.1.0 Fetching railties 6.0.3 Installing railties 6.0.3 Fetching sprockets 4.0.2 Installing sprockets 4.0.2 Fetching sprockets-rails 3.2.2 Installing sprockets-rails 3.2.2 Fetching rails 6.0.3 Installing rails 6.0.3 Bundle complete! 1 Gemfile dependency, 44 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Removing intermediate container 4cb172198c08 ---> d9cdd41c2813 Step 10/10 : COPY . $APP_ROOT ---> 061e861ee58c Successfully built 061e861ee58c Successfully tagged perfect-rails2_web:latest WARNING: Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`. Creating perfect-rails2_web_run ... done exist force README.md create Rakefile create .ruby-version create config.ru force .gitignore force Gemfile run git init from "." Reinitialized existing Git repository in /app/.git/ create package.json create app create app/assets/config/manifest.js create app/assets/stylesheets/application.css create app/channels/application_cable/channel.rb create app/channels/application_cable/connection.rb create app/controllers/application_controller.rb create app/helpers/application_helper.rb create app/javascript/channels/consumer.js create app/javascript/channels/index.js create app/javascript/packs/application.js create app/jobs/application_job.rb create app/mailers/application_mailer.rb create app/models/application_record.rb create app/views/layouts/application.html.erb create app/views/layouts/mailer.html.erb create app/views/layouts/mailer.text.erb create app/assets/images create app/assets/images/.keep create app/controllers/concerns/.keep create app/models/concerns/.keep create bin create bin/rails create bin/rake create bin/setup create bin/yarn create config create config/routes.rb create config/application.rb create config/environment.rb create config/cable.yml create config/puma.rb create config/spring.rb create config/storage.yml create config/environments create config/environments/development.rb create config/environments/production.rb create config/environments/test.rb create config/initializers create config/initializers/application_controller_renderer.rb create config/initializers/assets.rb create config/initializers/backtrace_silencers.rb create config/initializers/content_security_policy.rb create config/initializers/cookies_serializer.rb create config/initializers/cors.rb create config/initializers/filter_parameter_logging.rb create config/initializers/inflections.rb create config/initializers/mime_types.rb create config/initializers/new_framework_defaults_6_0.rb create config/initializers/wrap_parameters.rb create config/locales create config/locales/en.yml create config/master.key append .gitignore create config/boot.rb create config/database.yml create db create db/seeds.rb create lib create lib/tasks create lib/tasks/.keep create lib/assets create lib/assets/.keep create log create log/.keep create public create public/404.html create public/422.html create public/500.html create public/apple-touch-icon-precomposed.png create public/apple-touch-icon.png create public/favicon.ico create public/robots.txt create tmp create tmp/.keep create tmp/pids create tmp/pids/.keep create tmp/cache create tmp/cache/assets create vendor create vendor/.keep create test/fixtures create test/fixtures/.keep create test/fixtures/files create test/fixtures/files/.keep create test/controllers create test/controllers/.keep create test/mailers create test/mailers/.keep create test/models create test/models/.keep create test/helpers create test/helpers/.keep create test/integration create test/integration/.keep create test/channels/application_cable/connection_test.rb create test/test_helper.rb create test/system create test/system/.keep create test/application_system_test_case.rb create storage create storage/.keep create tmp/storage create tmp/storage/.keep remove config/initializers/cors.rb remove config/initializers/new_framework_defaults_6_0.rb rails webpacker:install Could not find gem 'sqlite3 (~> 1.4)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems. ERROR: 1 ```
snyt45 commented 3 years ago

gemをインストール docker-compose run web bundle install

実行ログ
``` Creating perfect-rails2_web_run ... done 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`. Fetching gem metadata from https://rubygems.org/............ Fetching gem metadata from https://rubygems.org/. Resolving dependencies.... Using rake 13.0.6 Using concurrent-ruby 1.1.9 Using i18n 1.8.10 Using minitest 5.14.4 Using thread_safe 0.3.6 Using tzinfo 1.2.9 Using zeitwerk 2.4.2 Fetching activesupport 6.0.4 Installing activesupport 6.0.4 Using builder 3.2.4 Using erubi 1.10.0 Using mini_portile2 2.5.3 Using racc 1.5.2 Using nokogiri 1.11.7 (x86_64-linux) Using rails-dom-testing 2.0.3 Using crass 1.0.6 Using loofah 2.10.0 Using rails-html-sanitizer 1.3.0 Fetching actionview 6.0.4 Installing actionview 6.0.4 Using rack 2.2.3 Using rack-test 1.1.0 Fetching actionpack 6.0.4 Installing actionpack 6.0.4 Using nio4r 2.5.7 Using websocket-extensions 0.1.5 Using websocket-driver 0.7.5 Fetching actioncable 6.0.4 Installing actioncable 6.0.4 Using globalid 0.4.2 Fetching activejob 6.0.4 Installing activejob 6.0.4 Fetching activemodel 6.0.4 Installing activemodel 6.0.4 Fetching activerecord 6.0.4 Installing activerecord 6.0.4 Fetching marcel 1.0.1 Installing marcel 1.0.1 Fetching activestorage 6.0.4 Installing activestorage 6.0.4 Using mini_mime 1.1.0 Using mail 2.7.1 Fetching actionmailbox 6.0.4 Installing actionmailbox 6.0.4 Fetching actionmailer 6.0.4 Installing actionmailer 6.0.4 Fetching actiontext 6.0.4 Installing actiontext 6.0.4 Fetching public_suffix 4.0.6 Installing public_suffix 4.0.6 Fetching addressable 2.8.0 Installing addressable 2.8.0 Fetching bindex 0.8.1 Installing bindex 0.8.1 with native extensions Fetching msgpack 1.4.2 Installing msgpack 1.4.2 with native extensions Fetching bootsnap 1.7.5 Installing bootsnap 1.7.5 with native extensions Using bundler 1.17.2 Fetching byebug 11.1.3 Installing byebug 11.1.3 with native extensions Fetching regexp_parser 2.1.1 Installing regexp_parser 2.1.1 Fetching xpath 3.2.0 Installing xpath 3.2.0 Fetching capybara 3.35.3 Installing capybara 3.35.3 Fetching childprocess 3.0.0 Installing childprocess 3.0.0 Fetching ffi 1.15.3 Installing ffi 1.15.3 with native extensions Fetching jbuilder 2.11.2 Installing jbuilder 2.11.2 Fetching rb-fsevent 0.11.0 Installing rb-fsevent 0.11.0 Fetching rb-inotify 0.10.1 Installing rb-inotify 0.10.1 Fetching listen 3.5.1 Installing listen 3.5.1 Using method_source 1.0.0 Fetching puma 4.3.8 Installing puma 4.3.8 with native extensions Fetching rack-proxy 0.7.0 Installing rack-proxy 0.7.0 Using thor 1.1.0 Fetching railties 6.0.4 Installing railties 6.0.4 Using sprockets 4.0.2 Using sprockets-rails 3.2.2 Fetching rails 6.0.4 Installing rails 6.0.4 Fetching rubyzip 2.3.2 Installing rubyzip 2.3.2 Fetching sassc 2.4.0 Installing sassc 2.4.0 with native extensions Fetching tilt 2.0.10 Installing tilt 2.0.10 Fetching sassc-rails 2.1.2 Installing sassc-rails 2.1.2 Fetching sass-rails 6.0.0 Installing sass-rails 6.0.0 Fetching selenium-webdriver 3.142.7 Installing selenium-webdriver 3.142.7 Fetching spring 2.1.1 Installing spring 2.1.1 Fetching spring-watcher-listen 2.0.1 Installing spring-watcher-listen 2.0.1 Fetching sqlite3 1.4.2 Installing sqlite3 1.4.2 with native extensions Fetching turbolinks-source 5.2.0 Installing turbolinks-source 5.2.0 Fetching turbolinks 5.2.1 Installing turbolinks 5.2.1 Fetching web-console 4.1.0 Installing web-console 4.1.0 Fetching webdrivers 4.6.0 Installing webdrivers 4.6.0 Fetching webpacker 4.3.0 Installing webpacker 4.3.0 Bundle complete! 17 Gemfile dependencies, 74 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from rubyzip: RubyZip 3.0 is coming! ********************** The public API of some Rubyzip classes has been modernized to use named parameters for optional arguments. Please check your usage of the following classes: * `Zip::File` * `Zip::Entry` * `Zip::InputStream` * `Zip::OutputStream` Please ensure that your Gemfiles and .gemspecs are suitably restrictive to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0). See https://github.com/rubyzip/rubyzip for details. The Changelog also lists other enhancements and bugfixes that have been implemented since version 2.3.0. ```
snyt45 commented 3 years ago

webpackerをインストール docker-compose run --rm web rails webpacker:install

実行ログ
``` Creating perfect-rails2_web_run ... done create config/webpacker.yml Copying webpack core config create config/webpack create config/webpack/development.js create config/webpack/environment.js create config/webpack/production.js create config/webpack/test.js Copying postcss.config.js to app root directory create postcss.config.js Copying babel.config.js to app root directory create babel.config.js Copying .browserslistrc to app root directory create .browserslistrc The JavaScript app source directory already exists apply /usr/local/bundle/gems/webpacker-4.3.0/lib/install/binstubs.rb Copying binstubs exist bin create bin/webpack create bin/webpack-dev-server append .gitignore Installing all JavaScript dependencies [4.3.0] run yarn add @rails/webpacker@4.3.0 from "." yarn add v1.22.5 info No lockfile found. [1/4] Resolving packages... warning @rails/webpacker > node-sass > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning @rails/webpacker > node-sass > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning @rails/webpacker > node-sass > request > har-validator@5.1.5: this library is no longer supported warning @rails/webpacker > node-sass > request > 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. warning @rails/webpacker > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. warning @rails/webpacker > webpack > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. warning @rails/webpacker > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. warning @rails/webpacker > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning @rails/webpacker > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated [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... [4/4] Building fresh packages... success Saved lockfile. success Saved 604 new dependencies. info Direct dependencies ├─ @rails/actioncable@6.1.4 ├─ @rails/activestorage@6.1.4 ├─ @rails/ujs@6.1.4 ├─ @rails/webpacker@4.3.0 └─ turbolinks@5.2.0 info All dependencies ├─ @babel/code-frame@7.14.5 ├─ @babel/compat-data@7.14.7 ├─ @babel/core@7.14.6 ├─ @babel/helper-builder-binary-assignment-operator-visitor@7.14.5 ├─ @babel/helper-compilation-targets@7.14.5 ├─ @babel/helper-explode-assignable-expression@7.14.5 ├─ @babel/helper-get-function-arity@7.14.5 ├─ @babel/helper-module-imports@7.14.5 ├─ @babel/helper-plugin-utils@7.14.5 ├─ @babel/helper-wrap-function@7.14.5 ├─ @babel/helpers@7.14.6 ├─ @babel/highlight@7.14.5 ├─ @babel/parser@7.14.7 ├─ @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.14.5 ├─ @babel/plugin-proposal-async-generator-functions@7.14.7 ├─ @babel/plugin-proposal-class-properties@7.14.5 ├─ @babel/plugin-proposal-class-static-block@7.14.5 ├─ @babel/plugin-proposal-dynamic-import@7.14.5 ├─ @babel/plugin-proposal-export-namespace-from@7.14.5 ├─ @babel/plugin-proposal-json-strings@7.14.5 ├─ @babel/plugin-proposal-logical-assignment-operators@7.14.5 ├─ @babel/plugin-proposal-nullish-coalescing-operator@7.14.5 ├─ @babel/plugin-proposal-numeric-separator@7.14.5 ├─ @babel/plugin-proposal-object-rest-spread@7.14.7 ├─ @babel/plugin-proposal-optional-catch-binding@7.14.5 ├─ @babel/plugin-proposal-private-methods@7.14.5 ├─ @babel/plugin-proposal-private-property-in-object@7.14.5 ├─ @babel/plugin-proposal-unicode-property-regex@7.14.5 ├─ @babel/plugin-syntax-class-properties@7.12.13 ├─ @babel/plugin-syntax-top-level-await@7.14.5 ├─ @babel/plugin-transform-arrow-functions@7.14.5 ├─ @babel/plugin-transform-async-to-generator@7.14.5 ├─ @babel/plugin-transform-block-scoped-functions@7.14.5 ├─ @babel/plugin-transform-block-scoping@7.14.5 ├─ @babel/plugin-transform-classes@7.14.5 ├─ @babel/plugin-transform-computed-properties@7.14.5 ├─ @babel/plugin-transform-destructuring@7.14.7 ├─ @babel/plugin-transform-dotall-regex@7.14.5 ├─ @babel/plugin-transform-duplicate-keys@7.14.5 ├─ @babel/plugin-transform-exponentiation-operator@7.14.5 ├─ @babel/plugin-transform-for-of@7.14.5 ├─ @babel/plugin-transform-function-name@7.14.5 ├─ @babel/plugin-transform-literals@7.14.5 ├─ @babel/plugin-transform-member-expression-literals@7.14.5 ├─ @babel/plugin-transform-modules-amd@7.14.5 ├─ @babel/plugin-transform-modules-commonjs@7.14.5 ├─ @babel/plugin-transform-modules-systemjs@7.14.5 ├─ @babel/plugin-transform-modules-umd@7.14.5 ├─ @babel/plugin-transform-named-capturing-groups-regex@7.14.7 ├─ @babel/plugin-transform-new-target@7.14.5 ├─ @babel/plugin-transform-object-super@7.14.5 ├─ @babel/plugin-transform-property-literals@7.14.5 ├─ @babel/plugin-transform-regenerator@7.14.5 ├─ @babel/plugin-transform-reserved-words@7.14.5 ├─ @babel/plugin-transform-runtime@7.14.5 ├─ @babel/plugin-transform-shorthand-properties@7.14.5 ├─ @babel/plugin-transform-spread@7.14.6 ├─ @babel/plugin-transform-sticky-regex@7.14.5 ├─ @babel/plugin-transform-template-literals@7.14.5 ├─ @babel/plugin-transform-typeof-symbol@7.14.5 ├─ @babel/plugin-transform-unicode-escapes@7.14.5 ├─ @babel/plugin-transform-unicode-regex@7.14.5 ├─ @babel/preset-env@7.14.7 ├─ @babel/preset-modules@0.1.4 ├─ @babel/runtime@7.14.6 ├─ @npmcli/move-file@1.1.2 ├─ @rails/actioncable@6.1.4 ├─ @rails/activestorage@6.1.4 ├─ @rails/ujs@6.1.4 ├─ @rails/webpacker@4.3.0 ├─ @types/json-schema@7.0.8 ├─ @types/parse-json@4.0.0 ├─ @types/q@1.5.5 ├─ @webassemblyjs/floating-point-hex-parser@1.9.0 ├─ @webassemblyjs/helper-code-frame@1.9.0 ├─ @webassemblyjs/helper-fsm@1.9.0 ├─ @webassemblyjs/helper-wasm-section@1.9.0 ├─ @webassemblyjs/wasm-edit@1.9.0 ├─ @webassemblyjs/wasm-opt@1.9.0 ├─ @xtuc/ieee754@1.2.0 ├─ abbrev@1.1.1 ├─ acorn@6.4.2 ├─ ajv-errors@1.0.1 ├─ ajv-keywords@3.5.2 ├─ ajv@6.12.6 ├─ amdefine@1.0.1 ├─ ansi-styles@3.2.1 ├─ anymatch@3.1.2 ├─ are-we-there-yet@1.1.5 ├─ argparse@1.0.10 ├─ arr-flatten@1.1.0 ├─ array-find-index@1.0.2 ├─ asn1.js@5.4.1 ├─ asn1@0.2.4 ├─ assert@1.5.0 ├─ assign-symbols@1.0.0 ├─ async-each@1.0.3 ├─ async-foreach@0.1.3 ├─ asynckit@0.4.0 ├─ atob@2.1.2 ├─ autoprefixer@9.8.6 ├─ aws-sign2@0.7.0 ├─ aws4@1.11.0 ├─ babel-loader@8.2.2 ├─ babel-plugin-macros@2.8.0 ├─ base@0.11.2 ├─ base64-js@1.5.1 ├─ bcrypt-pbkdf@1.0.2 ├─ binary-extensions@2.2.0 ├─ block-stream@0.0.9 ├─ bluebird@3.7.2 ├─ boolbase@1.0.0 ├─ brace-expansion@1.1.11 ├─ braces@2.3.2 ├─ brorand@1.1.0 ├─ browserify-aes@1.2.0 ├─ browserify-cipher@1.0.1 ├─ browserify-des@1.0.2 ├─ browserify-rsa@4.1.0 ├─ browserify-sign@4.2.1 ├─ browserify-zlib@0.2.0 ├─ buffer-xor@1.0.3 ├─ buffer@4.9.2 ├─ builtin-status-codes@3.0.0 ├─ cacache@13.0.1 ├─ cache-base@1.0.1 ├─ caller-callsite@2.0.0 ├─ caller-path@2.0.0 ├─ callsites@2.0.0 ├─ camelcase-keys@2.1.0 ├─ camelcase@5.3.1 ├─ caniuse-lite@1.0.30001245 ├─ case-sensitive-paths-webpack-plugin@2.4.0 ├─ caseless@0.12.0 ├─ chokidar@3.5.2 ├─ chownr@1.1.4 ├─ chrome-trace-event@1.0.3 ├─ cipher-base@1.0.4 ├─ class-utils@0.3.6 ├─ clean-stack@2.2.0 ├─ cliui@5.0.0 ├─ clone-deep@4.0.1 ├─ coa@2.0.2 ├─ code-point-at@1.1.0 ├─ collection-visit@1.0.0 ├─ color-convert@1.9.3 ├─ color-name@1.1.3 ├─ color-string@1.5.5 ├─ color@3.1.3 ├─ colorette@1.2.2 ├─ combined-stream@1.0.8 ├─ commander@2.20.3 ├─ compression-webpack-plugin@4.0.1 ├─ concat-map@0.0.1 ├─ concat-stream@1.6.2 ├─ console-browserify@1.2.0 ├─ console-control-strings@1.1.0 ├─ constants-browserify@1.0.0 ├─ convert-source-map@1.8.0 ├─ copy-concurrently@1.0.5 ├─ copy-descriptor@0.1.1 ├─ core-js-compat@3.15.2 ├─ core-js@3.15.2 ├─ core-util-is@1.0.2 ├─ create-ecdh@4.0.4 ├─ create-hmac@1.1.7 ├─ cross-spawn@3.0.1 ├─ crypto-browserify@3.12.0 ├─ css-blank-pseudo@0.1.4 ├─ css-color-names@0.0.4 ├─ css-declaration-sorter@4.0.1 ├─ css-has-pseudo@0.10.0 ├─ css-loader@3.6.0 ├─ css-prefers-color-scheme@3.1.1 ├─ css-select-base-adapter@0.1.1 ├─ css-select@2.1.0 ├─ css-tree@1.0.0-alpha.37 ├─ css-what@3.4.2 ├─ cssdb@4.4.0 ├─ cssnano-preset-default@4.0.8 ├─ cssnano-util-raw-cache@4.0.1 ├─ cssnano-util-same-parent@4.0.1 ├─ cssnano@4.1.11 ├─ csso@4.2.0 ├─ currently-unhandled@0.4.1 ├─ cyclist@1.0.1 ├─ dashdash@1.14.1 ├─ debug@4.3.2 ├─ decamelize@1.2.0 ├─ decode-uri-component@0.2.0 ├─ delayed-stream@1.0.0 ├─ delegates@1.0.0 ├─ des.js@1.0.1 ├─ detect-file@1.0.0 ├─ diffie-hellman@5.0.3 ├─ dom-serializer@0.2.2 ├─ domain-browser@1.2.0 ├─ domelementtype@1.3.1 ├─ domutils@1.7.0 ├─ dot-prop@5.3.0 ├─ duplexify@3.7.1 ├─ ecc-jsbn@0.1.2 ├─ electron-to-chromium@1.3.776 ├─ emoji-regex@7.0.3 ├─ enhanced-resolve@4.5.0 ├─ entities@2.2.0 ├─ errno@0.1.8 ├─ error-ex@1.3.2 ├─ es-abstract@1.18.3 ├─ es-to-primitive@1.2.1 ├─ escalade@3.1.1 ├─ escape-string-regexp@1.0.5 ├─ eslint-scope@4.0.3 ├─ esprima@4.0.1 ├─ esrecurse@4.3.0 ├─ estraverse@4.3.0 ├─ esutils@2.0.3 ├─ events@3.3.0 ├─ expand-brackets@2.1.4 ├─ expand-tilde@2.0.2 ├─ extend@3.0.2 ├─ extglob@2.0.4 ├─ extsprintf@1.3.0 ├─ fast-deep-equal@3.1.3 ├─ fast-json-stable-stringify@2.1.0 ├─ file-loader@4.3.0 ├─ fill-range@4.0.0 ├─ findup-sync@3.0.0 ├─ flatted@2.0.2 ├─ flatten@1.0.3 ├─ flush-write-stream@1.1.1 ├─ for-in@1.0.2 ├─ forever-agent@0.6.1 ├─ form-data@2.3.3 ├─ from2@2.3.0 ├─ fs.realpath@1.0.0 ├─ fstream@1.0.12 ├─ gauge@2.7.4 ├─ gaze@1.1.3 ├─ gensync@1.0.0-beta.2 ├─ get-caller-file@2.0.5 ├─ get-intrinsic@1.1.1 ├─ get-value@2.0.6 ├─ getpass@0.1.7 ├─ glob-parent@5.1.2 ├─ glob@7.1.7 ├─ global-modules@2.0.0 ├─ global-prefix@3.0.0 ├─ globule@1.3.2 ├─ har-schema@2.0.0 ├─ har-validator@5.1.5 ├─ has-ansi@2.0.0 ├─ has-bigints@1.0.1 ├─ has-unicode@2.0.1 ├─ has-value@1.0.0 ├─ hash.js@1.1.7 ├─ hex-color-regex@1.1.0 ├─ hmac-drbg@1.0.1 ├─ hosted-git-info@2.8.9 ├─ hsl-regex@1.0.0 ├─ hsla-regex@1.0.0 ├─ http-signature@1.2.0 ├─ https-browserify@1.0.0 ├─ ieee754@1.2.1 ├─ import-cwd@2.1.0 ├─ import-fresh@2.0.0 ├─ import-from@2.1.0 ├─ import-local@2.0.0 ├─ in-publish@2.0.1 ├─ indent-string@2.1.0 ├─ infer-owner@1.0.4 ├─ inflight@1.0.6 ├─ ini@1.3.8 ├─ interpret@1.4.0 ├─ is-absolute-url@2.1.0 ├─ is-accessor-descriptor@1.0.0 ├─ is-arrayish@0.2.1 ├─ is-bigint@1.0.2 ├─ is-binary-path@2.1.0 ├─ is-boolean-object@1.1.1 ├─ is-callable@1.2.3 ├─ is-color-stop@1.1.0 ├─ is-core-module@2.5.0 ├─ is-data-descriptor@1.0.0 ├─ is-date-object@1.0.4 ├─ is-descriptor@1.0.2 ├─ is-directory@0.3.1 ├─ is-extglob@2.1.1 ├─ is-finite@1.1.0 ├─ is-glob@4.0.1 ├─ is-negative-zero@2.0.1 ├─ is-number-object@1.0.5 ├─ is-obj@2.0.0 ├─ is-plain-obj@1.1.0 ├─ is-plain-object@2.0.4 ├─ is-regex@1.1.3 ├─ is-resolvable@1.1.0 ├─ is-string@1.0.6 ├─ is-symbol@1.0.4 ├─ is-typedarray@1.0.0 ├─ is-utf8@0.2.1 ├─ is-windows@1.0.2 ├─ is-wsl@1.1.0 ├─ isarray@1.0.0 ├─ isexe@2.0.0 ├─ isstream@0.1.2 ├─ jest-worker@25.5.0 ├─ js-base64@2.6.4 ├─ js-tokens@4.0.0 ├─ jsesc@2.5.2 ├─ json-parse-better-errors@1.0.2 ├─ json-parse-even-better-errors@2.3.1 ├─ json-schema-traverse@0.4.1 ├─ json-schema@0.2.3 ├─ json-stringify-safe@5.0.1 ├─ jsprim@1.4.1 ├─ last-call-webpack-plugin@3.0.0 ├─ lines-and-columns@1.1.6 ├─ load-json-file@1.1.0 ├─ loader-runner@2.4.0 ├─ locate-path@3.0.0 ├─ lodash.debounce@4.0.8 ├─ lodash.get@4.4.2 ├─ lodash.has@4.5.2 ├─ lodash.memoize@4.1.2 ├─ lodash.uniq@4.5.0 ├─ lodash@4.17.21 ├─ loud-rejection@1.6.0 ├─ make-dir@3.1.0 ├─ map-obj@1.0.1 ├─ map-visit@1.0.0 ├─ mdn-data@2.0.4 ├─ memory-fs@0.4.1 ├─ meow@3.7.0 ├─ merge-stream@2.0.0 ├─ micromatch@3.1.10 ├─ miller-rabin@4.0.1 ├─ mime-db@1.48.0 ├─ mime-types@2.1.31 ├─ mini-css-extract-plugin@0.8.2 ├─ minimatch@3.0.4 ├─ minimist@1.2.5 ├─ minizlib@2.1.2 ├─ mississippi@3.0.0 ├─ mixin-deep@1.3.2 ├─ mkdirp@0.5.5 ├─ ms@2.1.2 ├─ nan@2.14.2 ├─ nanomatch@1.2.13 ├─ nice-try@1.0.5 ├─ node-gyp@3.8.0 ├─ node-libs-browser@2.2.1 ├─ node-releases@1.1.73 ├─ node-sass@4.14.1 ├─ nopt@3.0.6 ├─ normalize-package-data@2.5.0 ├─ normalize-range@0.1.2 ├─ normalize-url@1.9.1 ├─ npmlog@4.1.2 ├─ nth-check@1.0.2 ├─ num2fraction@1.2.2 ├─ number-is-nan@1.0.1 ├─ oauth-sign@0.9.0 ├─ object-assign@4.1.1 ├─ object-copy@0.1.0 ├─ object-inspect@1.11.0 ├─ object.assign@4.1.2 ├─ object.getownpropertydescriptors@2.1.2 ├─ object.values@1.1.4 ├─ optimize-css-assets-webpack-plugin@5.0.8 ├─ os-browserify@0.3.0 ├─ os-homedir@1.0.2 ├─ os-tmpdir@1.0.2 ├─ osenv@0.1.5 ├─ p-limit@2.3.0 ├─ p-locate@3.0.0 ├─ p-map@3.0.0 ├─ p-try@2.2.0 ├─ pako@1.0.11 ├─ parallel-transform@1.2.0 ├─ parent-module@1.0.1 ├─ parse-asn1@5.1.6 ├─ parse-json@4.0.0 ├─ parse-passwd@1.0.0 ├─ pascalcase@0.1.1 ├─ path-browserify@0.0.1 ├─ path-complete-extname@1.0.0 ├─ path-dirname@1.0.2 ├─ path-exists@3.0.0 ├─ path-is-absolute@1.0.1 ├─ path-key@2.0.1 ├─ path-parse@1.0.7 ├─ path-type@4.0.0 ├─ performance-now@2.1.0 ├─ picomatch@2.3.0 ├─ pinkie@2.0.4 ├─ pnp-webpack-plugin@1.6.4 ├─ posix-character-classes@0.1.1 ├─ postcss-attribute-case-insensitive@4.0.2 ├─ postcss-calc@7.0.5 ├─ postcss-color-functional-notation@2.0.1 ├─ postcss-color-gray@5.0.0 ├─ postcss-color-hex-alpha@5.0.3 ├─ postcss-color-mod-function@3.0.3 ├─ postcss-color-rebeccapurple@4.0.1 ├─ postcss-colormin@4.0.3 ├─ postcss-convert-values@4.0.1 ├─ postcss-custom-media@7.0.8 ├─ postcss-custom-properties@8.0.11 ├─ postcss-custom-selectors@5.1.2 ├─ postcss-dir-pseudo-class@5.0.0 ├─ postcss-discard-comments@4.0.2 ├─ postcss-discard-duplicates@4.0.2 ├─ postcss-discard-empty@4.0.1 ├─ postcss-discard-overridden@4.0.1 ├─ postcss-double-position-gradients@1.0.0 ├─ postcss-env-function@2.0.2 ├─ postcss-flexbugs-fixes@4.2.1 ├─ postcss-focus-visible@4.0.0 ├─ postcss-focus-within@3.0.0 ├─ postcss-font-variant@4.0.1 ├─ postcss-gap-properties@2.0.0 ├─ postcss-image-set-function@3.0.1 ├─ postcss-import@12.0.1 ├─ postcss-initial@3.0.4 ├─ postcss-lab-function@2.0.1 ├─ postcss-load-config@2.1.2 ├─ postcss-loader@3.0.0 ├─ postcss-logical@3.0.0 ├─ postcss-media-minmax@4.0.0 ├─ postcss-merge-longhand@4.0.11 ├─ postcss-merge-rules@4.0.3 ├─ postcss-minify-font-values@4.0.2 ├─ postcss-minify-gradients@4.0.2 ├─ postcss-minify-params@4.0.2 ├─ postcss-minify-selectors@4.0.2 ├─ postcss-modules-extract-imports@2.0.0 ├─ postcss-modules-local-by-default@3.0.3 ├─ postcss-modules-scope@2.2.0 ├─ postcss-modules-values@3.0.0 ├─ postcss-nesting@7.0.1 ├─ postcss-normalize-charset@4.0.1 ├─ postcss-normalize-display-values@4.0.2 ├─ postcss-normalize-positions@4.0.2 ├─ postcss-normalize-repeat-style@4.0.2 ├─ postcss-normalize-string@4.0.2 ├─ postcss-normalize-timing-functions@4.0.2 ├─ postcss-normalize-unicode@4.0.1 ├─ postcss-normalize-url@4.0.1 ├─ postcss-normalize-whitespace@4.0.2 ├─ postcss-ordered-values@4.1.2 ├─ postcss-overflow-shorthand@2.0.0 ├─ postcss-page-break@2.0.0 ├─ postcss-place@4.0.1 ├─ postcss-preset-env@6.7.0 ├─ postcss-pseudo-class-any-link@6.0.0 ├─ postcss-reduce-initial@4.0.3 ├─ postcss-reduce-transforms@4.0.2 ├─ postcss-replace-overflow-wrap@3.0.0 ├─ postcss-safe-parser@4.0.2 ├─ postcss-selector-matches@4.0.0 ├─ postcss-selector-not@4.0.1 ├─ postcss-svgo@4.0.3 ├─ postcss-unique-selectors@4.0.1 ├─ prepend-http@1.0.4 ├─ process-nextick-args@2.0.1 ├─ process@0.11.10 ├─ prr@1.0.1 ├─ pseudomap@1.0.2 ├─ psl@1.8.0 ├─ public-encrypt@4.0.3 ├─ pump@3.0.0 ├─ pumpify@1.5.1 ├─ punycode@2.1.1 ├─ q@1.5.1 ├─ qs@6.5.2 ├─ query-string@4.3.4 ├─ querystring-es3@0.2.1 ├─ querystring@0.2.0 ├─ randomfill@1.0.4 ├─ read-cache@1.0.0 ├─ read-pkg-up@1.0.1 ├─ read-pkg@1.1.0 ├─ readable-stream@2.3.7 ├─ readdirp@3.6.0 ├─ redent@1.0.0 ├─ regenerate-unicode-properties@8.2.0 ├─ regenerator-runtime@0.13.7 ├─ regenerator-transform@0.14.5 ├─ regexpu-core@4.7.1 ├─ regjsgen@0.5.2 ├─ regjsparser@0.6.9 ├─ remove-trailing-separator@1.1.0 ├─ repeat-element@1.1.4 ├─ repeating@2.0.1 ├─ request@2.88.2 ├─ require-directory@2.1.1 ├─ require-main-filename@2.0.0 ├─ resolve-cwd@2.0.0 ├─ resolve-dir@1.0.1 ├─ resolve-url@0.2.1 ├─ resolve@1.20.0 ├─ ret@0.1.15 ├─ rgb-regex@1.0.1 ├─ rgba-regex@1.0.0 ├─ run-queue@1.0.3 ├─ sass-graph@2.2.5 ├─ sass-loader@7.3.1 ├─ sax@1.2.4 ├─ schema-utils@2.7.1 ├─ scss-tokenizer@0.2.3 ├─ semver@6.3.0 ├─ set-blocking@2.0.0 ├─ set-value@2.0.1 ├─ setimmediate@1.0.5 ├─ shallow-clone@3.0.1 ├─ shebang-command@1.2.0 ├─ shebang-regex@1.0.0 ├─ simple-swizzle@0.2.2 ├─ snapdragon-node@2.1.1 ├─ snapdragon-util@3.0.1 ├─ sort-keys@1.1.2 ├─ source-list-map@2.0.1 ├─ source-map-resolve@0.5.3 ├─ source-map-support@0.5.19 ├─ source-map-url@0.4.1 ├─ spark-md5@3.0.1 ├─ spdx-correct@3.1.1 ├─ spdx-exceptions@2.3.0 ├─ split-string@3.1.0 ├─ sprintf-js@1.0.3 ├─ sshpk@1.16.1 ├─ ssri@7.1.1 ├─ stable@0.1.8 ├─ static-extend@0.1.2 ├─ stdout-stream@1.4.1 ├─ stream-browserify@2.0.2 ├─ stream-each@1.2.3 ├─ stream-http@2.8.3 ├─ strict-uri-encode@1.1.0 ├─ string_decoder@1.3.0 ├─ string.prototype.trimend@1.0.4 ├─ string.prototype.trimstart@1.0.4 ├─ strip-bom@2.0.0 ├─ strip-indent@1.0.1 ├─ style-loader@1.3.0 ├─ stylehacks@4.0.3 ├─ svgo@1.3.2 ├─ tar@2.2.2 ├─ terser-webpack-plugin@2.3.8 ├─ terser@4.8.0 ├─ through2@2.0.5 ├─ timers-browserify@2.0.12 ├─ timsort@0.3.0 ├─ to-arraybuffer@1.0.1 ├─ to-fast-properties@2.0.0 ├─ to-object-path@0.3.0 ├─ to-regex-range@2.1.1 ├─ tough-cookie@2.5.0 ├─ trim-newlines@1.0.0 ├─ true-case-path@1.0.3 ├─ ts-pnp@1.2.0 ├─ tty-browserify@0.0.0 ├─ tunnel-agent@0.6.0 ├─ turbolinks@5.2.0 ├─ tweetnacl@0.14.5 ├─ typedarray@0.0.6 ├─ unbox-primitive@1.0.1 ├─ unicode-canonical-property-names-ecmascript@1.0.4 ├─ unicode-match-property-ecmascript@1.0.4 ├─ unicode-match-property-value-ecmascript@1.2.0 ├─ unicode-property-aliases-ecmascript@1.1.0 ├─ union-value@1.0.1 ├─ unique-slug@2.0.2 ├─ unquote@1.1.1 ├─ unset-value@1.0.0 ├─ upath@1.2.0 ├─ uri-js@4.4.1 ├─ urix@0.1.0 ├─ url@0.11.0 ├─ use@3.1.1 ├─ util-deprecate@1.0.2 ├─ util.promisify@1.0.1 ├─ util@0.11.1 ├─ uuid@3.4.0 ├─ v8-compile-cache@2.3.0 ├─ validate-npm-package-license@3.0.4 ├─ vendors@1.0.4 ├─ verror@1.10.0 ├─ vm-browserify@1.1.2 ├─ watchpack-chokidar2@2.0.1 ├─ watchpack@1.7.5 ├─ webpack-assets-manifest@3.1.1 ├─ webpack-cli@3.3.12 ├─ webpack@4.46.0 ├─ which-boxed-primitive@1.0.2 ├─ which-module@2.0.0 ├─ which@1.3.1 ├─ wide-align@1.1.3 ├─ worker-farm@1.7.0 ├─ wrap-ansi@5.1.0 ├─ xtend@4.0.2 ├─ yaml@1.10.2 └─ yargs-parser@13.1.2 Done in 59.40s. Installing dev server for live reloading run yarn add --dev webpack-dev-server from "." yarn add v1.22.5 [1/4] Resolving packages... 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. [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 > webpack-dev-middleware@3.7.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning " > webpack-dev-server@3.11.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". [4/4] Building fresh packages... success Saved lockfile. success Saved 104 new dependencies. info Direct dependencies └─ webpack-dev-server@3.11.2 info All dependencies ├─ @types/glob@7.1.4 ├─ @types/minimatch@3.0.5 ├─ @types/node@16.3.2 ├─ accepts@1.3.7 ├─ ansi-colors@3.2.4 ├─ ansi-html@0.0.7 ├─ array-flatten@1.1.1 ├─ array-union@1.0.2 ├─ array-uniq@1.0.3 ├─ async-limiter@1.0.1 ├─ async@2.6.3 ├─ batch@0.6.1 ├─ body-parser@1.19.0 ├─ bonjour@3.5.0 ├─ buffer-indexof@1.1.1 ├─ compressible@2.0.18 ├─ compression@1.7.4 ├─ connect-history-api-fallback@1.6.0 ├─ content-disposition@0.5.3 ├─ cookie-signature@1.0.6 ├─ cookie@0.4.0 ├─ deep-equal@1.1.1 ├─ default-gateway@4.2.0 ├─ del@4.1.1 ├─ destroy@1.0.4 ├─ detect-node@2.1.0 ├─ dns-equal@1.0.0 ├─ dns-packet@1.3.4 ├─ dns-txt@2.0.2 ├─ ee-first@1.1.1 ├─ eventemitter3@4.0.7 ├─ eventsource@1.1.0 ├─ execa@1.0.0 ├─ express@4.17.1 ├─ finalhandler@1.1.2 ├─ follow-redirects@1.14.1 ├─ forwarded@0.2.0 ├─ get-stream@4.1.0 ├─ globby@6.1.0 ├─ handle-thing@2.0.1 ├─ hpack.js@2.1.6 ├─ html-entities@1.4.0 ├─ http-deceiver@1.2.7 ├─ http-parser-js@0.5.3 ├─ http-proxy-middleware@0.19.1 ├─ http-proxy@1.18.1 ├─ internal-ip@4.3.0 ├─ ip-regex@2.1.0 ├─ ip@1.1.5 ├─ ipaddr.js@1.9.1 ├─ is-absolute-url@3.0.3 ├─ is-arguments@1.1.0 ├─ is-path-cwd@2.2.0 ├─ is-path-in-cwd@2.1.0 ├─ is-path-inside@2.1.0 ├─ is-stream@1.1.0 ├─ json3@3.3.3 ├─ killable@1.0.1 ├─ loglevel@1.7.1 ├─ media-typer@0.3.0 ├─ merge-descriptors@1.0.1 ├─ methods@1.1.2 ├─ mime@2.5.2 ├─ multicast-dns-service-types@1.1.0 ├─ multicast-dns@6.2.3 ├─ negotiator@0.6.2 ├─ node-forge@0.10.0 ├─ npm-run-path@2.0.2 ├─ object-is@1.1.5 ├─ obuf@1.1.2 ├─ on-headers@1.0.2 ├─ opn@5.5.0 ├─ original@1.0.2 ├─ p-finally@1.0.0 ├─ p-map@2.1.0 ├─ p-retry@3.0.1 ├─ path-is-inside@1.0.2 ├─ path-to-regexp@0.1.7 ├─ portfinder@1.0.28 ├─ proxy-addr@2.0.7 ├─ querystringify@2.2.0 ├─ raw-body@2.4.0 ├─ regexp.prototype.flags@1.3.1 ├─ retry@0.12.0 ├─ select-hose@2.0.0 ├─ selfsigned@1.10.11 ├─ serve-index@1.9.1 ├─ serve-static@1.14.1 ├─ sockjs-client@1.5.1 ├─ sockjs@0.3.21 ├─ spdy-transport@3.0.0 ├─ spdy@4.0.2 ├─ strip-eof@1.0.0 ├─ thunky@1.1.0 ├─ type-is@1.6.18 ├─ unpipe@1.0.0 ├─ url-parse@1.5.1 ├─ utils-merge@1.0.1 ├─ wbuf@1.7.3 ├─ webpack-dev-middleware@3.7.3 ├─ webpack-dev-server@3.11.2 ├─ websocket-driver@0.7.4 ├─ websocket-extensions@0.1.4 └─ ws@6.2.2 Done in 7.66s. Webpacker successfully installed 🎉 🍰 ```
snyt45 commented 3 years ago

docker-compose up後、http://localhost:3000/ にアクセス

image

1章でやったおかげで環境構築がエラーなくできるようになった。

snyt45 commented 3 years ago

書籍モデル作成

docker-compose run --rm web bin/rails g model Book \
name:string \
published_on:date \
price:integer
実行ログ
``` Creating perfect-rails2_web_run ... done invoke active_record create db/migrate/20210716001106_create_books.rb create app/models/book.rb invoke test_unit create test/models/book_test.rb create test/fixtures/books.yml ```
snyt45 commented 3 years ago

マイグレーションの内容をDBへ反映

docker-compose run --rm web  bin/rails db:create
docker-compose run --rm web  bin/rails db:migrate
実行ログ
``` ❯ docker-compose run --rm web bin/rails db:create Creating perfect-rails2_web_run ... done Database 'db/development.sqlite3' already exists Created database 'db/test.sqlite3' perfect-rails2 on  master [?⇡] via  v10.24.1 via 💎 took 5s ❯ docker-compose run --rm web bin/rails db:migrate Creating perfect-rails2_web_run ... done == 20210716001106 CreateBooks: migrating ====================================== -- create_table(:books) -> 0.0016s == 20210716001106 CreateBooks: migrated (0.0020s) ============================= ```
snyt45 commented 3 years ago

書籍のデータを作成する

(1..5).each do |i|
  Book.create(
    name: "Book #{i}",
    published_on: Time.parse("20191224").ago(i.months),
    price: (i * 1000),
  )
end
実行ログ
``` (0.1ms) begin transaction Book Create (0.3ms) INSERT INTO "books" ("name", "published_on", "price", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "Book 1"], ["published_on", "2019-11-24"], ["price", 1000], ["created_at", "2021-07-16 00:23:10.452159"], ["updated_at", "2021-07-16 00:23:10.452159"]] (5.3ms) commit transaction (0.0ms) begin transaction Book Create (0.2ms) INSERT INTO "books" ("name", "published_on", "price", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "Book 2"], ["published_on", "2019-10-24"], ["price", 2000], ["created_at", "2021-07-16 00:23:10.464220"], ["updated_at", "2021-07-16 00:23:10.464220"]] (5.1ms) commit transaction (0.0ms) begin transaction Book Create (0.6ms) INSERT INTO "books" ("name", "published_on", "price", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "Book 3"], ["published_on", "2019-09-24"], ["price", 3000], ["created_at", "2021-07-16 00:23:10.471747"], ["updated_at", "2021-07-16 00:23:10.471747"]] (5.1ms) commit transaction (0.0ms) begin transaction Book Create (0.2ms) INSERT INTO "books" ("name", "published_on", "price", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "Book 4"], ["published_on", "2019-08-24"], ["price", 4000], ["created_at", "2021-07-16 00:23:10.485763"], ["updated_at", "2021-07-16 00:23:10.485763"]] (4.2ms) commit transaction (0.0ms) begin transaction Book Create (0.6ms) INSERT INTO "books" ("name", "published_on", "price", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "Book 5"], ["published_on", "2019-07-24"], ["price", 5000], ["created_at", "2021-07-16 00:23:10.492434"], ["updated_at", "2021-07-16 00:23:10.492434"]] (7.7ms) commit transaction => 1..5 ```
snyt45 commented 3 years ago

出版社、著者モデルを作成

docker-compose run --rm web bin/rails g model Publisher name:string address:text
docker-compose run --rm web bin/rails g model Author name:string penname:string
docker-compose run --rm web bin/rails db:migrate
実行ログ
``` ❯ docker-compose run --rm web bin/rails g model Publisher name:string address:text Creating network "perfect-rails2_default" with the default driver Creating perfect-rails2_web_run ... done invoke active_record create db/migrate/20210718051624_create_publishers.rb create app/models/publisher.rb invoke test_unit create test/models/publisher_test.rb create test/fixtures/publishers.yml ``` ``` ❯ docker-compose run --rm web bin/rails g model Author name:string penname:string Creating perfect-rails2_web_run ... done invoke active_record create db/migrate/20210718051812_create_authors.rb create app/models/author.rb invoke test_unit create test/models/author_test.rb create test/fixtures/authors.yml ``` ``` ❯ docker-compose run --rm web bin/rails db:migrate Creating perfect-rails2_web_run ... done == 20210718051624 CreatePublishers: migrating ================================= -- create_table(:publishers) -> 0.0022s == 20210718051624 CreatePublishers: migrated (0.0024s) ======================== == 20210718051812 CreateAuthors: migrating ==================================== -- create_table(:authors) -> 0.0017s == 20210718051812 CreateAuthors: migrated (0.0019s) =========================== ```
snyt45 commented 3 years ago

書籍モデルと出版社モデルの関連付けを確認

docker exec -it (docker-compose ps -q web) /bin/bash # webコンテナに入る
rails c # コンソール開く
book = Book.new(name: "パーフェクトRails")
publisher = book.build_publisher
publisher.assign_attributes(name: "技術評論社")
book.save!

book = Book.find(1)
book.publisher

publisher = Publisher.find(1)
publisher.books
snyt45 commented 3 years ago

書籍と著者モデルの中間テーブルを作成する

docker-compose run --rm web bin/rails g model BookAuthor book:references author:references
docker-compose run --rm web bin/rails db:migrate
実行ログ
``` ❯ docker-compose run --rm web bin/rails g model BookAuthor book:references author:references Creating network "perfect-rails2_default" with the default driver Creating perfect-rails2_web_run ... done invoke active_record create db/migrate/20210719003044_create_book_authors.rb create app/models/book_author.rb invoke test_unit create test/models/book_author_test.rb create test/fixtures/book_authors.yml ``` ``` ❯ docker-compose run --rm web bin/rails db:migrate Creating perfect-rails2_web_run ... done == 20210719003044 CreateBookAuthors: migrating ================================ -- create_table(:book_authors) -> 0.0041s == 20210719003044 CreateBookAuthors: migrated (0.0042s) ======================= ```
snyt45 commented 3 years ago

改めてデータを用意しなおそうとリセットして、Book.create(..)でデータを作ろうとしてもデータが作れない。。

# DB初期化、マイグレーション実行
docker-compose run --rm web bin/rails db:migrate:reset
snyt45 commented 3 years ago

Author.createはINSERT文が発行される。 Book.createはINSERT文が発行されない…

snyt45 commented 3 years ago

Book.create!

irb(main):009:0> Book.create!
Traceback (most recent call last):
        2: from (irb):9
        1: from (irb):9:in `rescue in irb_binding'
ActiveRecord::RecordInvalid (Validation failed: Publisher must exist)

関連付けをした後なので、出版社が必須みたいだ。

snyt45 commented 3 years ago

データを用意する

# DB初期化、マイグレーション実行
docker-compose run --rm web bin/rails db:migrate:reset
docker exec -it (docker-compose ps -q web) /bin/bash # webコンテナに入る
rails c # コンソール開く
# 出版社作成、書籍作成(出版社関連付け)
publisher = Publisher.create(name: "Gihyo inc.", address: "Ichigaya")
publisher.books << Book.create(name: "Book 1", published_on: Time.current, price: 1000)
publisher.books << Book.create(name: "Book 2", published_on: Time.current, price: 2000)
publisher.save!

# 著者作成
matz = Author.create(name: "Matsumoto Yukihiro", penname: "Matz")
dhh = Author.create(name: "David Heinemeier Hansson", penname: "DHH")
matz.books << Book.find(1)
matz.books << Book.find(2)
matz.reload.books.count # オブジェクトの状態ではなく、DBのデータを引き直す

book = Book.find(1)
book.authors << dhh
book.reload.authors.pluck(:name)
snyt45 commented 3 years ago

書籍と著者の多対多がテーブル上どうなっているか確認する

docker exec -it (docker-compose ps -q web) /bin/bash # webコンテナに入る
bin/rails db # dbコンソール開く

著者テーブル確認

sqlite> .mode line # DBの出力結果をわかりやすくする
sqlite> select * from authors;
        id = 1
      name = Matsumoto Yukihiro
   penname = Matz
created_at = 2021-07-20 00:23:57.883678
updated_at = 2021-07-20 00:23:57.883678

        id = 2
      name = David Heinemeier Hansson
   penname = DHH
created_at = 2021-07-20 00:24:02.955754
updated_at = 2021-07-20 00:24:02.955754

書籍テーブル確認

sqlite> select * from books;
          id = 1
        name = Book 1
published_on = 2021-07-20
       price = 1000
  created_at = 2021-07-20 00:21:07.535169
  updated_at = 2021-07-20 00:21:07.535169
publisher_id = 1

          id = 2
        name = Book 2
published_on = 2021-07-20
       price = 2000
  created_at = 2021-07-20 00:21:14.516856
  updated_at = 2021-07-20 00:21:14.516856
publisher_id = 1

書籍と著者の中間テーブル確認

sqlite> select * from book_authors;
        id = 1
   book_id = 1
 author_id = 1
created_at = 2021-07-20 00:24:07.973617
updated_at = 2021-07-20 00:24:07.973617

        id = 2
   book_id = 2
 author_id = 1
created_at = 2021-07-20 00:24:12.588286
updated_at = 2021-07-20 00:24:12.588286

        id = 3
   book_id = 1
 author_id = 2
created_at = 2021-07-20 00:25:37.429434
updated_at = 2021-07-20 00:25:37.429434
snyt45 commented 3 years ago

Bookモデルに販売状況カラムの追加

❯ docker-compose run --rm web bin/rails g migration AddStatusToBooks sales_status:integer
Creating perfect-rails2_web_run ... done
      invoke  active_record
      create    db/migrate/20210724020924_add_status_to_books.rb

❯ docker-compose run --rm web bin/rails db:migrate
Creating perfect-rails2_web_run ... done
== 20210724020924 AddStatusToBooks: migrating =================================
-- add_column(:books, :sales_status, :integer)
   -> 0.0019s
== 20210724020924 AddStatusToBooks: migrated (0.0022s) ========================
snyt45 commented 3 years ago

Booksコントローラーの作成

❯ docker-compose run --rm web bin/rails g controller books
      create  app/controllers/books_controller.rb
      invoke  erb
      create    app/views/books
      invoke  test_unit
      create    test/controllers/books_controller_test.rb
      invoke  helper
      create    app/helpers/books_helper.rb
      invoke    test_unit
      invoke  assets
      invoke    scss
      create      app/assets/stylesheets/books.scss
snyt45 commented 3 years ago

resources :publishersで追加されるルーティング

     publishers GET    /publishers(.:format)            publishers#index
                POST   /publishers(.:format)            publishers#create
  new_publisher GET    /publishers/new(.:format)        publishers#new
 edit_publisher GET    /publishers/:id/edit(.:format)   publishers#edit
      publisher GET    /publishers/:id(.:format)        publishers#show
                PATCH  /publishers/:id(.:format)        publishers#update
                PUT    /publishers/:id(.:format)        publishers#update
                DELETE /publishers/:id(.:format)        publishers#destroy
snyt45 commented 3 years ago

書籍管理アプリケーションに管理者を登録し、ログインする場合のresourceの例

❯ docker-compose run --rm web bin/rails g model User name:string password:string email:string
      invoke  active_record
      create    db/migrate/20210727001059_create_users.rb
      create    app/models/user.rb
      invoke    test_unit
      create      test/models/user_test.rb
      create      test/fixtures/users.yml
❯ docker-compose run --rm web bin/rails g controller Profiles show edit update
      create  app/controllers/profiles_controller.rb
       route  get 'profiles/show'
get 'profiles/edit'
get 'profiles/update'
      invoke  erb
      create    app/views/profiles
      create    app/views/profiles/show.html.erb
      create    app/views/profiles/edit.html.erb
      create    app/views/profiles/update.html.erb
      invoke  test_unit
      create    test/controllers/profiles_controller_test.rb
      invoke  helper
      create    app/helpers/profiles_helper.rb
      invoke    test_unit
      invoke  assets
      invoke    scss
      create      app/assets/stylesheets/profiles.scss
❯ docker-compose run --rm web bin/rails db:migrate
== 20210727001059 CreateUsers: migrating ======================================
-- create_table(:users)
   -> 0.0018s
== 20210727001059 CreateUsers: migrated (0.0020s) =============================
snyt45 commented 3 years ago

resource :profileで追加されるルーティング

 new_profile GET    /profile/new(.:format)  profiles#new
edit_profile GET    /profile/edit(.:format) profiles#edit
     profile GET    /profile(.:format)      profiles#show
             PATCH  /profile(.:format)      profiles#update
             PUT    /profile(.:format)      profiles#update
             DELETE /profile(.:format)      profiles#destroy
             POST   /profile(.:format)      profiles#create