Hi. I decided to start keeping track of things while I learn to code. I wrote this one after the fact, so future posts will be more explicit in errors, commands, and sources.
After accepting my Friday and Saturday decisions during the morning hours, on Sunday afternoon I was ready to do work on solving an error. And I was apparently ready to break BASH, break it real good and thorough-like. I wanted to fix a problem, didn’t know what a PATH was, what a bin was, or wtf a chown was, so I rm -f’ed my way into a command line that could only cd into files.
The original error (which now, looks like a tiny inconvenience) was thrown with the jasmine-headless-webkit gem, which requires the qt library I had installed with Homebrew. It (qt) wasn’t properly accessible because it had been relegated to an Xcode directory not included in PATH. If that sounds like a bunch of pretty, made-up words to you, I felt the same way at a point I can count back to in hours.
To illustrate, this is a picture of what at one point looked like a great idea (no).
Here are some lessons I learned.
1. PATH is a really really powerful resource to understand. It is easy to access your profile in your home directory under ~/.bash_profile (I mean, when you have un-broken your system enough to get yourself an ‘ls’ command, hot damn). It’s also easy to very thoroughly ruin things.
- Here are some places to read up on it:
- https://github.com/johnbintz/jasmine-headless-webkit/issues/104 (my specific issue)
- http://hacktux.com/bash/bashrc/bash_profile (overview of ~/.bash_profile and ~/.bashrc)
- http://shellzero.wordpress.com/2012/03/18/how-to-editchange-the-path-environment-variables-mac-os-x-3/ (a good walkthrough)
2. RVM is a good thing.
- Its docs were super helpful when I thought that I had killed Rails for everyone (I had only obscurred the command ‘rails’): https://rvm.io/
3. MacPorts is not my jam.
4. ‘rm’ means rm, which means remove files only when you mean it.
5. -f, —HARD, and sudo are not good decisions when your inner monologue is getting vulgar or when you’re distracted by a side game of Emoji Movie Titles.
6. Related to 4, when everything blows up, don’t get obsessed with solving it immediately. Let a friend or a kind hostage take you to ice cream. There’s no reason to sit there and bang your head against a wall that could fall away as soon as you get some raspberry sorbet and perspective away from the problem.
7. Contradictory to 5, don’t give up. If you messed it up, you can hack it back together (right?).