Roots Error #102 – composer create-project roots/sage mysite 8.5.3 zsh: command not found: composer

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.

 

The Problem

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.

 

The Solution

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

Thencd ~/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.

Categories: Bedrock, Linux, Mac, Roots, Sage Theme, Trellis, Ubuntu
  • Exact matches only
    Search in title
    Search in content
    Search in posts
    Search in pages
    Filter by Categories
    10
    8.1
    AdWords
    Analytics
    Apple
    Bedrock
    Blade
    Business Development
    Company News
    Content Marketing
    Freelancing
    Gaming
    Linux
    Mac
    Operating Systems
    OS X
    Pay Per Click Management
    Paypal
    PHP
    Press Releases
    Programming
    Razer
    Reviews
    Roots
    Sage Theme
    Search Engine Marketing
    Search Engine Optimization
    Search Marketing
    Tips and Tricks
    Trellis
    Tutorials
    Ubuntu
    Uncategorized
    Video Production
    Website Development
    Website Development
    Windows
  • Recent Posts

  • Categories

  • Would You Like a Quick Call?

    We're happy to spend 30 minutes answering any of your questions and showing you the first steps to make your business "add up".

    From Our Blog




    The First 5 Things You Should Know When Using ‘Screen’

    Categories: Uncategorized

    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? […]

    Continue Reading »

    Roots Error #1 – Failed to connect to the host via ssh: Permission denied (publickey).

    Categories: Bedrock, Roots, Trellis

    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 […]

    Continue Reading »

    Roots Error #103 – ERROR! Invalid vars plugin version from /Users/myusers/Sites/mysite.com/trellis/lib/trellis/plugins/vars/version.py

    Categories: Bedrock, PHP, Programming, Roots, Sage Theme, Trellis

    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 […]

    Continue Reading »

    About

    Since 2005 we've been offering digital and content marketing strategy and implementation. Including website development, search engine optimization and marketing, search marketing and more.

    Continue Reading »

    Contact

    Email

    us@theportlandcompany.com

    Phone

    503-567-9561

    Follow

  • Logo for The Portland Company with a Coyote