I have a this config
version: 2.1
executors:
default:
working_directory: ~/derekbarber_mysql
docker:
- image: cimg/ruby:2.7-node
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
BUNDLER_VERSION: 2.1.4
RAILS_ENV: test
DB_HOST: 127.0.0.1
DB_USERNAME: root
DB_PASSWORD: ''
- image: circleci/mysql:8.0.18
command: [--default-authentication-plugin=mysql_native_password]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'true'
MYSQL_ROOT_HOST: '%'
commands:
configure_bundler:
description: Configure bundler
steps:
- run:
name: Configure bundler
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
jobs:
build:
executor: default
steps:
- checkout
- run: mv config/database.yml.example config/database.yml
- run: mv config/application.example.yml config/application.yml
- restore_cache:
keys:
- derekbarber_mysql-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- derekbarber_mysql-
- configure_bundler
- run:
name: Install bundle
command: bundle install
- run:
name: Wait for DB
command: dockerize -wait tcp://127.0.0.1:3306 -timeout 1m
- run:
name: Setup DB
command: bundle exec rails db:create db:schema:load --trace
- run:
name: RSpec
command: |
bundle exec rspec -t newtests
- store_artifacts:
path: coverage
- save_cache:
key: derekbarber_mysql-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- persist_to_workspace:
root: ~/
paths:
- ./derekbarber_mysql
workflows:
version: 2
integration:
jobs:
- build
And Iam getting this error
Check the “Autoloading and Reloading Constants” guide to learn more about how
Rails autoloads and reloads.
(called from at /home/circleci/derekbarber_mysql/config/environment.rb:5)
Couldn’t find the MJML 4. binary… have you run $ npm install mjml?
** Execute db:load_config
** Execute db:create
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
Couldn’t create ‘onepageplan_test’ database. Please check your configuration.
rails aborted!
ActiveRecord::ConnectionNotEstablished: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
What Iam doind wrong?