Roots Discourse

Errors - New to Roots sage, Trellis and Bedrock


#1

Hi.

As the title says Im new to Roots and trying to test it all out for a new website. I am having issues when running my local environment with Yarn Strat. I get the attached screenshot.

Any idea what I may have done wrong. I’m pretty sure I’ve followed the instructions well, but thinking maybe I’ve missed something now!


#2

Hi davey,

Your screenshot suggests to me that your folder structure is not correct. Can you show us your folder structure i.e. Where are the trellis and Bedrock folders stored?

Also, when you run vagrant up were there any errors?


#3

I haven’t worked with Trellis but I do get an error like that with Bedrock if I forget to run composer update when setting up a new site. Maybe that’s the cause?


#4

Hi Codepuncher and folbert, thanks for taking the time to respond. My file structure looks the same as all the examples.

I’ve tried starting again from scratch but now when I run vagrant up from trellis it gets stuck on TASK [wordpress-install : Install Dependencies with Composer]

Not too sure what to try now!


#5

This sounds a lot like this issue. Try the solution provided here:


#6

Thanks for the replies. I’ve now actually upgraded Vagrant to 2.2.2 I was on 2.2.1.

Vagrant up now runs fine but I’m now back to the errors in my original post.

Looking into my files a bit more in site/web/app/wp I just have one file called “55ba7427347dfafebd30f4a5bf222d94”

This doesn’t look right as looking at the repo for https://github.com/roots/roots-example-project.com it should be the WP core


#7

Based on that original screenshot it just looks like Composer hasn’t installed any dependencies, since WordPress isn’t installed. To do this manually, run:

# host @ example.com/trellis
$ vagrant ssh
# vagrant box @ /srv/www/example.com/current
$ composer install

You can also do this on the host machine, but it’s better to run it on the VM. In a scenario when Trellis installs correctly, this step would have already been complete. With that being said, you may want to reprovision to ensure everything was setup correctly:

# host @ example.com/trellis
$ vagrant reload --provision

Or start from complete scratch:

# host @ example.com/trellis
$ vagrant destroy
$ vagrant up

Very strange. Maybe this is an artifact of the unsuccessful Composer installs from the prior set up. Is there anything else in the site/web/app directory?

Actually, it should be the custom content directory that Bedrock uses. A properly installed Bedrock site should look like this:

site
├── composer.json
├── config
├── vendor              ← Other Composer dependencies
└── web
    ├── app             ← Bedrock’s custom content folder
    │   ├── mu-plugins
    │   ├── plugins
    │   ├── themes
    │   └── uploads
    ├── wp-config.php
    ├── index.php       ← Web entrypoint
    └── wp              ← WordPress installed via Composer

Bedrock installs WordPress in a separate directory (web/wp).


#8

Thanks for the reply Knowler

OK I’ve done what you have recommended and everything is up and running - thanks a lot and to everyone else. Looking forward to testing it all out now. :slight_smile: