Sage 9 Beta 4 w Trellis/Bedrock Deployment: Autoloader not found

Hey everyone!

I’ve successfully provisioned and deployed a site updated from Sage 9 Beta 3 to Beta 4. Everything shows up green in the Trellis terminal. On development the site runs fine however when I navigate to the production webpage it says “Sage › ErrorAutoloader not found… You must run composer install from the Sage directory”. The same error appears when I try to use the WP cli on the server to change to a default theme for testing.

I’ve of course ran composer install and yarn build:production before deployment but I figure there’s something else going on here.

I ssh’d into the production server sql db and under options the “template” and “stylesheet” are set to “mytheme/resources”. The wp-admin is not accessible because of a server 500 error.

I managed to get my site back with rollback.yml (this works perfectly, thank you).

Any ideas?


When you deployed your site did you include the vendor directory? Or did running composer install on the server create vendor correctly?

Basically check if vendor exists.



Checked, yes, the current release vendor directory does exist with bin, composer, johnpbloch, oscarotero, roots and vlucas dependencies installed under it.

I’d assumed this was a problem with upgrading from Sage beta 3 to beta 4 on my production server.

However I’ve now also tried it on a fresh DO staging server and the issue remains the same.

The setup is the latest and greatest:
Sage 9.0.0-beta.4
Bedrock WordPress 4.9
Trellis 1.0.0-rc.2
Vagrant 2.0.1
Virtualbox 5.2.0

Hi @krishaamer,

This might be a little late, but have you tried editing your build-before.yml file?
See here:

Behaviour Found
Pushing local database to production using WP Migrate DB Pro resulted in an error:

Sage › Error
Autoloader not found… You must run composer install from the Sage directory

This worked for me, running Sage 9.0.0-beta.4

Uncomment the deploy-hooks already provided by the roots team for Sage 9 in trellis/deploy-hooks/build-before.yml.

Make sure you replace ‘sage’ with your theme name.

1 Like

Hi @willneill, yes that same approach had fixed it back when I had this issue. I forgot to came back here to update the thread. I didn’t see in the docs it’s neccesary to do anything with build-before.yml, so that’s why the confusion. Thank you!

Hey @krishaamer - great to hear it worked for you too.

@ben or @swalkinshaw: perhaps a more prominent mention of the build-before file would be good in the Trellis documentation. Following the documentation step-by-step from what I’ve seen doesn’t appear to include this at the moment, which can lead to some stress for new roots users.

This is already covered in the Sage deployment documentation: