Need help on fresh install of trellis, bedrock, and sage locally on Mac Catalina

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.

  1. I have installed the latest Composer, Vagrant, Yarn, Ansible, Python 3, and Virtualbox 6.0 on my Mac Catalina (10.15.2).
  2. mkdir sites/example.com && cd example.com
  3. git clone --depth=1 https://github.com/roots/trellis.git && rm -rf trellis/.git
  4. composer create-project roots/bedrock site
  5.  # 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
    
  6.  #  group_vars/development/vault.yml
     vault_wordpress_sites:
       example.com:
         admin_password: root
         env:
           db_password: root
    
  7. cd trellis && vagrant up
  8. # 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"]}
    
  9. example.test appeared on Vituralbox anyways, so I ignored that error and run vagrant ssh
  10. and I created an empty composer.json file: cd /srv/www/example.com/current && touch composer.json
  11. exit to quit ssh
  12. # 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"}
    
  13. I opened a new Terminal tab and cd sites/example.com/site/web/app/themes/
  14. composer create-project roots/sage mytheme && cd mytheme
  15. yarn && yarn start
  16. 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!

Alright, I finally figured it out myself… You gotta give Full Disk Access (Preference>Security & Privacy>Privacy) to /sbin/nfsd on MacOS Catalina.

3 Likes

This topic was automatically closed after 42 days. New replies are no longer allowed.