I spent hours to research and still failed to setup trellis+bedrock+sage locally on my Mac. I’ll just list my setup processes. Maybe there’s something that I missed and you can help to point it out.
- I have installed the latest Composer, Vagrant, Yarn, Ansible, Python 3, and Virtualbox 6.0 on my Mac Catalina (10.15.2).
mkdir sites/example.com && cd example.com
git clone --depth=1 https://github.com/roots/trellis.git && rm -rf trellis/.git
composer create-project roots/bedrock site
-
# group_vars/development/wordpress_sites.yml wordpress_sites: example.com: site_hosts: - canonical: example.test local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root) admin_email: admin@example.test multisite: enabled: false ssl: enabled: false cache: enabled: false
-
# group_vars/development/vault.yml vault_wordpress_sites: example.com: admin_password: root env: db_password: root
cd trellis && vagrant up
-
# and then I got this error message: TASK [wordpress-install : Install Dependencies with Composer] ****************** System info: Ansible 2.9.0; Vagrant 2.2.6; Darwin Trellis Head --------------------------------------------------- Composer could not find a composer.json file in /srv/www/example.com/current To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section failed: [default] (item=example.com) => {"ansible_loop_var": "item", "changed": false, "item": {"key": "example.com", "value": {"admin_email": "admin@example.test", "cache": {"enabled": false}, "local_path": "../site", "multisite": {"enabled": false}, "site_hosts": [{"canonical": "example.test", "redirects": ["www.example.test"]}], "ssl": {"enabled": false, "provider": "self-signed"}}}, "stdout": "Composer could not find a composer.json file in /srv/www/example.com/current\nTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section\n", "stdout_lines": ["Composer could not find a composer.json file in /srv/www/example.com/current", "To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section"]}
- example.test appeared on Vituralbox anyways, so I ignored that error and run
vagrant ssh
- and I created an empty composer.json file:
cd /srv/www/example.com/current && touch composer.json
-
exit
to quit ssh -
# I then entered 'vagrant provision' and got the follow error: TASK [mariadb : Set root user password] **************************************** System info: Ansible 2.9.0; Vagrant 2.2.6; Darwin Trellis Head --------------------------------------------------- unable to connect to database: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") failed: [default] (item=default) => {"ansible_loop_var": "item", "changed": false, "item": "default"} --------------------------------------------------- unable to connect to database: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") failed: [default] (item=127.0.0.1) => {"ansible_loop_var": "item", "changed": false, "item": "127.0.0.1"} --------------------------------------------------- unable to connect to database: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") failed: [default] (item=::1) => {"ansible_loop_var": "item", "changed": false, "item": "::1"} --------------------------------------------------- unable to connect to database: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") failed: [default] (item=localhost) => {"ansible_loop_var": "item", "changed": false, "item": "localhost"}
- I opened a new Terminal tab and
cd sites/example.com/site/web/app/themes/
composer create-project roots/sage mytheme && cd mytheme
yarn && yarn start
- http://localhost:3000 shows 403 Forbidden, but Browsersync UI works on http://localhost:3001
I have no idea why it didn’t install Wordpress onto Virtualbox. Please help!