Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Bourbon won't install using "bourbon install" in mac Terminal

Hello fellow Team Treehouse members,

I've been trying to add Bourbon to one of my projects today. Unfortunately I am unable to run the commands of bourbon.

The gem is installed but the commands just won't work.

I keep getting: -bash: bourbon: command not found

I am currently running macOS Sierra - version 10.12.6 I am running SASS 3.5.1. (Bleeding Edge) (which i installed today)

Can anyone help me with this topic?

Kind regards,

Benjamin Kuijs

10 Answers

Rich Zimmerman
Rich Zimmerman
24,063 Points

You most likely need to update your PATH environment variable to include your path to Bourbon. if you run

echo $PATH

you can see if your path to Bourbon is listed, my guess is that it's not. in which case you just need to update your .bashrc or .zshc file.

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Hi Rich,

Thank you for your reply!

If i run echo $ PATH in my terminal i get this result:

MacBook-Air-van-Benjamin:~ benjaminkuijs$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

But i am not really sure if i am really targeting bourbon this way..

How do you update a .bashrc or .zshc file?

Rich Zimmerman
Rich Zimmerman
24,063 Points

If you cd to your home directory

cd

and type

ls -al

You should have something like

-rw-r--r--    1 username  ANT\Domain Users     202 Jun  1 09:55 .bash_profile

I'm assuming it'll be .bash_profile (i'm running the same macOS as you) You'll want to add a line similar to this, but with the path to Bourbon

PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH

In this example I'm adding my path to python3.6 to the PATH variable, which is..

PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin

and then appending the EXISTING path variable to the end of that, which is this part..

 :${PATH}"

and then exporting the updated PATH variable to account for the changes i've made with

export PATH

So you'll want to do the same thing, you just need to find the path to your Bourbon program, if i had to guess it might be in a path similar to my python3.6 path - but you can run the find command if you're having trouble

find / -name "Bourbon" 2> /dev/null 
Benjamin Kuijs
Benjamin Kuijs
17,022 Points

I 've cd to my home directory, i get:

MacBook-Air-van-Benjamin:~ benjaminkuijs$

I've typed ls -al:

I get a total of 168 but none of them is a .bash_profile I do have .bash_history and .bash_sessions

Not sure what to do next to find .bash_profile?

My bourbon file is in my home directory

Rich Zimmerman
Rich Zimmerman
24,063 Points

if Bourbon is in your home directory then just add /Users/benjaminkuijs to your path. In your home directory, when you type

ls -al

what files do you see that begin with "." in the file name?

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Hi Rich,

I've just typed in the terminal:

ls -al /Users/benjaminkuijs

This is the result i get: What do you recommend to do?

MacBook-Air-van-Benjamin:~ benjaminkuijs$ ls -al /Users/benjaminkuijs total 168 drwxr-xr-x+ 37 benjaminkuijs staff 1258 14 sep 15:44 . drwxr-xr-x 5 root admin 170 30 okt 2016 .. -r-------- 1 benjaminkuijs staff 7 15 jan 2017 .CFUserTextEncoding -rw-r--r--@ 1 benjaminkuijs staff 22532 17 sep 16:52 .DS_Store drwxr-xr-x 2 benjaminkuijs staff 68 8 okt 2012 .InstallAnywhere drwx------ 122 benjaminkuijs staff 4148 15 sep 13:43 .Trash drwxr-xr-x 15 benjaminkuijs staff 510 10 apr 21:08 .atom -rw------- 1 benjaminkuijs staff 7411 15 sep 20:33 .bash_history drwx------ 63 benjaminkuijs staff 2142 18 sep 08:06 .bash_sessions drwxr-xr-x 3 benjaminkuijs staff 102 7 apr 07:52 .config drwx------ 3 benjaminkuijs staff 102 1 apr 2015 .cups drwxr-xr-x 4 benjaminkuijs staff 136 14 sep 09:37 .gem -rwxrwxrwx@ 1 benjaminkuijs staff 30 19 sep 2012 .ghvgblirc -rw-r--r-- 1 benjaminkuijs staff 62 9 apr 14:30 .gitconfig drwxr-xr-x 3 benjaminkuijs staff 102 29 feb 2016 .oracle_jre_usage -rw------- 1 benjaminkuijs staff 12288 9 apr 14:44 .profile.swp -rw------- 1 root staff 1024 21 jun 07:51 .rnd drwx------ 7 benjaminkuijs staff 238 11 apr 17:00 .ssh -rw-r--r--@ 1 benjaminkuijs staff 17 19 sep 2012 .tfxumwvn -rw------- 1 benjaminkuijs staff 1134 20 apr 17:17 .viminfo drwx------ 4 benjaminkuijs staff 136 14 mei 20:18 Applications drwxrwxr-x@ 3 benjaminkuijs staff 102 17 sep 09:56 Creative Cloud Files drwx------+ 27 benjaminkuijs staff 918 17 sep 16:39 Desktop drwx------+ 28 benjaminkuijs staff 952 17 sep 16:56 Documents drwx------+ 118 benjaminkuijs staff 4012 15 sep 13:56 Downloads drwxr-xr-x 4 benjaminkuijs staff 136 10 apr 20:22 KUBE_PROJECTS drwx------+ 84 benjaminkuijs staff 2856 14 sep 10:58 Library drwx------+ 7 benjaminkuijs staff 238 13 jun 2015 Movies drwx------+ 6 benjaminkuijs staff 204 9 dec 2012 Music drwx------+ 62 benjaminkuijs staff 2108 15 jul 14:10 Pictures drwxr-xr-x+ 5 benjaminkuijs staff 170 15 sep 2012 Public -rwxr-xr-x 1 root staff 655 14 sep 14:43 bourbon -rw------- 1 benjaminkuijs staff 1679 11 apr 17:09 clear -rw-r--r-- 1 benjaminkuijs staff 426 11 apr 17:09 clear.pub drwxr-xr-x 5 benjaminkuijs staff 170 25 jan 2017 iCloud Drive (archief) -rwxr-xr-x 1 root staff 637 14 sep 13:35 thor

Rich Zimmerman
Rich Zimmerman
24,063 Points

Looks like you'll have to create a .bashrc file. And add your PATH to Bourbon

cd
touch .bashrc

I don't know if you're familiar with vi, i'll just use nano to edit the file for simplicity's sake

nano .bashrc

Make sure you have this in the file

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

And below that, add:

PATH=$PATH:/Users/benjaminkuijs/
export PATH

Then to save the file, hit ctrl+x -> y (to save) -> enter (to verify filename to save as)

source .bashrc

To implement the changes without having to reboot or signout and sign back in.

Assuming the executable Bourbon file is in your /Users/benjaminkuijs/ directory like you said, you should be good to go. You can check by typing

which Bourbon

and it should return

/Users/benjaminkuijs/
Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Hello Rich,

I've just tried the steps you recommended to add the file path. Some of the steps worked perfectly but i am unable to return the file path. Below you can find the results of the steps.

STEP1.

MacBook-Air-van-Benjamin:~ benjaminkuijs$ cd touch .bashrc
-bash: cd: touch: No such file or directory

STEP2. Worked!

STEP3.

MacBook-Air-van-Benjamin:~ benjaminkuijs$ source .bashrc

[Proces voltooid] "Proces completed - in Dutch"

STEP4.

MacBook-Air-van-Benjamin:~ benjaminkuijs$ which Bourbon
MacBook-Air-van-Benjamin:~ benjaminkuijs$ 

I can't figure out why it is not returning the file path.

Also because i am 100% sure Bourbon is in my home directory.

Last login: Tue Sep 19 08:30:37 on ttys000
MacBook-Air-van-Benjamin:~ benjaminkuijs$ /Users/benjaminkuijs/Bourbon ; exit;
Commands:
  Bourbon help [COMMAND]  # Describe available commands or one specific command
  Bourbon install         # Install Bourbon into your project
  Bourbon update          # Update Bourbon
  Bourbon version         # Show Bourbon version

logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Proces voltooid]
Rich Zimmerman
Rich Zimmerman
24,063 Points

Step one was 2 separate commands, but not totally necessary. cd, was to get to your home directory, and touch <filename> creates the file. nano <filename> will create the filename if it doesn't exist already, but I didn't know if you were on a work laptop or something where permissions might be an issue.

What is the output now when you run

echo $PATH

And can you paste your full .bashrc file?

Rich Zimmerman
Rich Zimmerman
24,063 Points

I just found this..

https://apple.stackexchange.com/questions/215550/missing-bash-profile-and-bashrc-files

try changing the filename to

.bash_profile

instead..

you can then remove this block..

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

as well.

See if that works.

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

I've tried two things based on your feedback:

  1. Rename .bashrc to .bash_profile, which gets me:

    MacBook-Air-van-Benjamin:~ benjaminkuijs$ nano .bashrc
    MacBook-Air-van-Benjamin:~ benjaminkuijs$ source .bash_profile
    MacBook-Air-van-Benjamin:~ benjaminkuijs$ which Bourbon
    /Users/benjaminkuijs//Bourbon
    
  2. Result of this process:

    MacBook-Air-van-Benjamin:~ benjaminkuijs$ Bourbon install
    Bourbon files already installed, doing nothing.
    MacBook-Air-van-Benjamin:~ benjaminkuijs$ Bourbon -v
    Bourbon 4.3.4
    

    This means the path is created and Bourbon is installed right? That also means that i can now add it to my project files..?

Rich Zimmerman
Rich Zimmerman
24,063 Points

Just about. It does appear to be working properly, but notice 1 thing (just to be safe).. when you run

which Bourbon

It comes back with a double slash between your username and Bourbon.

Go into the .bash_profile and remove the last slash after "Users/benjaminkuijs", save, and source .bash_profile again and it should be good to go.

If you run the which command again you should get back a valid path to the file and everything should be good to go.

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Yes it indeed comes back with a double //

I've changed the .bash_profile and deleted the / behind benjaminkuijs. Unfortunately this doesn't delete the double //

MacBook-Air-van-Benjamin:~ benjaminkuijs$ nano .bash_profile
MacBook-Air-van-Benjamin:~ benjaminkuijs$ source .bash_profile
MacBook-Air-van-Benjamin:~ benjaminkuijs$ which Bourbon
/Users/benjaminkuijs//Bourbon
MacBook-Air-van-Benjamin:~ benjaminkuijs$ 
Rich Zimmerman
Rich Zimmerman
24,063 Points

I'm not totally sure to be honest.

But if running Bourbon works, and you don't get a "no such file" type of error, then it should be working.

My concern with the trailing slash was that if Boubon is referenced through some package or script or something, the trailing slash might have the potential to cause issues. (Maybe cross that bridge if you get to it.)

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Yes i did run

source .bash_profile

Benjamin Kuijs
Benjamin Kuijs
17,022 Points

Well as long as it works for now i'll stick to it!

Thanks a lot for your help on this topic Rich! You've been very helpfull.

Rich Zimmerman
Rich Zimmerman
24,063 Points

No problem! Hopefully Treehouse will add more in depth unix courses to their library. Coding is awesome but you really need to have good knowledge of using and troubleshooting on unix operating systems for when you actually try to deploy your code.

I'm still learning a lot just from "on the job" scenarios.