Skip to content

Installation

Yurii Torbyk edited this page Jul 6, 2019 · 7 revisions
  1. Since Sage depends on Brew. Install or update Homebrew to the latest version using brew update.
# if not installed
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# add the next line into your ~/.bash_profile file (create if not exists)

export PATH="$PATH:/usr/local/sbin:$HOME/bin:$HOME/.composer/vendor/bin"


# if installed

brew update
brew upgrade
  1. Download phar package from the latest release and put it in $HOME/bin folder.
# Replace <version> with the current release version
curl -L https://github.com/ytorbyk/sage/releases/download/<version>/sage.phar > $HOME/bin/sage
chmod +x $HOME/bin/sage
  1. [Optional step] Customize configuration
# It creates configuration dump ~/xSage/config.php.
# You can customize and move it to ~/.sage/config.php before next step if you want.

sage env:config-dump
  1. Install and configure required environments
# It's automatic, you will prompt to enter your password once and two times MySQL root password.
# If you don't have installed MySQL before, just press enter (there is no password by default).
# After installation MySQL root password is 1 (until you changed it in ~/.sage/config.php config in node mysql.password)

sage env:install
  1. [Optional step] Install Bash completion for the application
sage env:completion
  1. Ready to use
# Displays a list of supported commands with short descriptions

sage list

Known issue

If you are using older than macOS High Sierra OS version or you upgraded it from older version and your system php version is older than v7.1.3 you cannot execute the phar archive.

In order to check your current system php version run next command: /usr/bin/php -v

Workaround

If your system php version is older than v7.1.3 you still can use Sage. Do next steps:

  • install php 7.1 manually via Brew: brew install [email protected], skip the step if you already have it installed
  • rename downloaded sage phar archive on bin-sage
  • create txt file ~/bin/sage
  • put the next text into the created file
#!/usr/bin/env bash
/usr/local/opt/[email protected]/bin/php "$HOME/bin/bin-sage" "$@"
  • make the text file executable with command chmod +x $HOME/bin/sage
  • Done. You can run sage in terminal