Lois Arce
Lois Arce

Reputation: 69

Laravel Spark Installation in MAC

I'm new to mac and I don't know how to add path to the system. I have already cloned the file for spark and done composer update. I need to this next step. How do I do it in MAC?

Next, make sure the spark-installer directory is added to your systems $PATH variable, so that your machine will be able to locate the spark executable when you issue Spark commands.

Upvotes: 1

Views: 1094

Answers (1)

Hamoud
Hamoud

Reputation: 1929

You do it by updating the PATH variable.

export PATH=$HOME/.composer/vendor/bin:$PATH

However, this will not persist. If you close the terminal window, the PATH will be restored to its original value. You need to add this line to your ~/.bash_profile

Run this command to add the line to your ~/bash_profile

echo 'export PATH=$HOME/.composer/vendor/bin:$PATH' >> ~/.bash_profile

To verify that you have the correct path: echo $PATH, and you should see .composer/vendor/bin in the middle of the output

For spark specifically, you need to add the path to the location where you cloned the repo.

echo 'export PATH=path/to/spark/repo:$PATH' >> ~/.bash_profile

Here is a full list of commands to install Spark:

cd $HOME
git clone https://github.com/laravel/spark-installer.git
echo 'export PATH=$HOME/spark-installer:$PATH' >> ~/.bash_profile
source ~/.bash_profile
cd ~/spark-installer
composer install
spark

Upvotes: 12

Related Questions