“sh: make: command not found”? and other Mountain Lion issues

mountain_lion

Yikes. As I was working on my Ruby on Rails freelance project (called Skqueak.com, it is an awesome app for iPhone, you should check it out if you have time) today, and encountered a head scratcher. While running bundle install, my gem install started failing, like “Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.” and Bundler quits. Further digging into error logs, it turns out that I was getting this error:

sh: make: command not found

Geez. Do I not have make? which make in the command line gets no response.

I’ve upgraded to Mountain Lion sometimes in September, and I guess many things have changed. Like built-in web server (More on this later.). But losing make? That is a little unsettling.

Did I ever mention I love StackOverflow? It is a great place to find people who are having the same kind of problem. Case in point: “sh: make: command not found” when running “$ bundle” after adding redcarpet gem to Rails app.

Sounds like I need to install the latest version of Xcode — 4.5.1 at the moment. You can get it from Apple’s App Store. It is a whopping 1.6 GB large, though. I may need a faster internet… (NOTE: I first tried to download both XCode and its command line tools from this link, but App Store rout worked out better for me.)

I installed it, restarted the machine, but the same result. which make in the command line still gets no response.

More StackOverflow reading (Thank you StackOverflow contributors, you make internet great!): Upgrading to Mountain Lion and XCode 4 broke my “make”? and installing “make” on Mac tells me that I need to enabled command line tools. XCode -> Preferences, then this:

Click on “Install” next to Command Line Tools (115.6 MB).

Would that do it?

Yay, command which make will now return /usr/bin/make, and my bundle is complete!

Thank goodness.

One other little annoyance in Mountain Lion is that there is no longer “Web Sharing.” Web sharing was an awesome way to create local testing environment on Mac, but for some reason, (probably security issues) they have disabled this. MacFixIt (now cnet) has a nice article on “How to enable Web Sharing in OS X Mountain Lion”, but I decided to go with MAMP. This way it is easier to control the entire machine’s web in one place — I set the home directory’s “Sites” folder to be root of MAMP, viewable by accessing localhost:8888, and I tend to work on WordPress themes and other database driven sites (JapaneseBallPlayers.com redesign is coming! … When I get to it… and I like to transform BaseballHackDay.com to be more useful full-resource site, much like datavisualization.ch… if I have time). Easy access to MyPhpAdmin is pretty sweet — just by visiting localhost:8888/MAMP/phpmyadmin — and if you know that you’ll be using php, you don’t have to manually activate php on the Mac OSX server, even though it is bundled.

13 Responses to ““sh: make: command not found”? and other Mountain Lion issues”

  1. Thank you so much! I figured make would be a part of the Xcode download, I’m glad you mentioned the extra step of installing command line tools!

  2. I cannot for the life of me begin to think why they would think command-line tools wouldn’t need to be there by default. Sure, for regular users. But regular users aren’t using XCode! It should pretty much be assumed that anyone installing XCode also knows what a terminal is, has enabled the rot account, and so on.

  3. Thanks for the tip. I would add that a restart is required, before installing the Command Line Tools. If you look at XCode -> Preference before restarting your machine, “Components” and “Documentation” are empty, and clicking “Check and Install Now” does nothing.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>