This year we began using Roots’ Trellis, Bedrock and Sage to develop and manage websites.
So far, I’ve only successfully completed one. But I’m actively working on three others. All riddled with obnoxious problems that seem to appear out of nowhere.
Luckily for me, I have four computers. Two Macs, one Windows and one Linux Ubuntu.
So when I get stuck on one of these computers I sometimes log onto the other and run the exact same commands there and either get new errors or work it out.
Today, I’m using the iMac with MacOS Sierra 10.12.6 and while attempting to install the Sage Theme into my Trellis + Bedrock stack I discovered I did not have Composer installed.
Now, I have installed it in the past, and probably uninstalled it because I encountered some previous error that lead me to think starting over would be easier than debugging.
So I followed the official instructions to install Composer, and when I run
php composer.phar I get the list of commands you can run with Composer, which means it’s working.
So I exit Terminal completely and navigate to my
site/web/app/themes/ folder and run
composer create-project roots/sage my-site 8.5.3 but I get an error:
zsh: command not found: composer
The only reason I can think this is happening is because ZSH must be looking in the wrong location for composer. But that doesn’t really make sense because if that was the case I should have gotten the same error when I ran
php composer.phar from
~/ earlier. At least by my logic. So it has to be something else.
After doing some more research, I stumbled across this post which indicated the location that Composer was installed has to be modified from it’s default install location. I first did this on my other Mac, and my Linux Ubuntu machine and don’t recall being required to take this step. Nor is it mentioned in the Roots docs. But upon relocating it to my global directory instead of my user directory I was able to rerun the original command in my Themes directory and it worked.
mv composer.phar /usr/local/bin/composer
cd ~/mysite.com/site/web/app/themes/ && composer create-project roots/sage my-site (this time I left off the version number because it automatically downloads the latest version anyway. It’s possible that that specify the version number so you can lock it in that way so it doesn’t accidentally update if you run a
composer update but I don’t update sites often at this point so that doesn’t matter to me.
Obviously, this is not an error with Roots, Trellis, Bedrock or Sage themselves. But I attribute it as a failure of the documentation there to specify this. I will propose to the community a patch on this. But so far most of the contributions I’ve made they reject because they seem to feel my issues are so acute that no one will ever experience them. Considering I manage about 12 developers who all ask the same questions I have to disagree. But, once again, I’m not in charge of their forums but at least I can post it here to help those who do experience the issue.
What is screen? screen is program that allows you to use multiple windows (virtual VT100 terminals) in Unix. In other words, instead of having a bunch of tabs open in Terminal to do different things at the same time you can run the commands below to show and hide them. How to use screen? […]
Earlier this year we began using Roots’ Trellis, Bedrock and Sage to develop and manage websites. While the system is everything WordPress should be. There are some things it should not be. One of them is temperamental, another is incredibly complicated. Today I’m working on our third project with Roots. But simultaneously with our second and […]
Aaaand we’re back. If you saw or read my previous two articles, those were related to project #2. This article, however, is related to project #3. The Problem I created the site and successfully worked on it on my Linux Ubuntu machine. I successfully deployed my work from development to staging went to bed. And then […]