yunyun_engineer
@yunyun_engineer (yunyun)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

CircleCI実行時、’command not found' yarnがインストールできません。

環境

ruby 2.6.5
rails 6
MySQL
M1チップ搭載macOS

解決したいこと

CircleCI起動時、’command not found'のエラーでtestが最後まで実行されません。 
yarnがインストールできません。
どういった解決策がありますか?
教えていただきたいです!

発生している問題・エラー

画像の説明をここに入力

また、”run: yarn install”の記述を取り除いてしまうと下記のエラーができます。

Failure/Error: <%= javascript_pack_tag 'application'%>

       ActionView::Template::Error:
         Webpacker can't find application in /home/circleci/sample_app/public/packs-test/manifest.json. Possible causes:
         1. You want to set webpacker.yml value of compile to true for your environment
            unless you are using the `webpack -w` or the webpack-dev-server.
         2. webpack has not yet re-run to reflect updates.
         3. You have misconfigured Webpacker's config/webpacker.yml file.
         4. Your webpack configuration is not creating a manifest.
         Your manifest contains:
         {
         }

該当するソースコード

config.yml

version: 2.1
orbs:
  ruby: circleci/ruby@1.1.2

jobs:
  build:
    docker:
      - image: circleci/ruby:2.6.5
    working_directory: ~/fridge_app
    steps:
      - checkout:
          path: ~/fridge_app
      - ruby/install-deps

  test:
      docker:
        - image: circleci/ruby:2.6.5
        - image: circleci/mysql:5.5
          environment:
            MYSQL_ROOT_PASSWORD: password
            MYSQL_DATABASE: fridge_app_test
      environment:
        BUNDLE_JOBS: "3"
        BUNDLE_RETRY: "3"
        FRIDGE_APP_DATABASE_HOST: "127.0.0.1"
        RAILS_ENV: test
      working_directory: ~/fridge_app
      steps:
        - checkout:
            path: ~/fridge_app
        - ruby/install-deps
        - run:
            name: Database setup
            command: bundle exec rails db:migrate
        - run:
            name: yarn install
            command: yarn install
        - run:
            name: test
            command: bundle exec rspec

workflows:
  version: 2
  build_and_test:
    jobs:
      - build
      - test:
          requires:
            - build

0

No Answers yet.

Your answer might help someone💌