10

I'm getting the following when running "$ bundle" after adding "gem 'redcarpet'" to Gemfile:

$ bundle
...
Using paperclip (2.3.11) 
Using passenger (3.0.7) 
Installing redcarpet (1.17.2) with native extensions /Users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

    /Users/robs/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb 
creating Makefile

make
sh: make: command not found

Gem files will remain installed in /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/gems/redcarpet-1.17.2 for inspection.
Results logged to /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/gems/redcarpet-1.17.2/ext/redcarpet/gem_make.out
from /Users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `block in build_extensions'
from /Users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:504:in `each'
from /Users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:504:in `build_extensions'
from /Users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `install'
from /Users/robs/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `block in install'
from /Users/robs/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
...
from /Users/robs/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.0.15/bin/bundle:13:in `<top (required)>'
from /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/bin/bundle:19:in `load'
from /Users/robs/.rvm/gems/ruby-1.9.2-p180@rails-3.0/bin/bundle:19:in `<main>'

Full gist here.

I am using rvm with different gemsets. This application is using the @rails-3.0 gemset. Here is my previous question regarding that setup.

I noticed the "Installing redcarpet (1.17.2)..." line includes "/Users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb". Is this part of the problem? How can I get this to install?

Thanks.

Community
  • 1
  • 1
robertwbradford
  • 6,181
  • 9
  • 36
  • 61
  • Also, I had recently installed a new hard drive and used a Time Machine backup to restore everything. Could this have anything to do with it? – robertwbradford Jul 01 '11 at 16:21
  • `make` is a system executable. Do you get a response to `which make` in the command line? If not, you might need to reinstall xcode. The older free version 3 is still available. – Steven Jul 10 '11 at 02:16

6 Answers6

16

Same issue aftering updating to Mountain Lion. You need to get the new command line tools and run:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 

Src: Upgrading to Mountain Lion and XCode 4 broke my "make"?

If after this you still get an error like this:

make: /usr/bin/gcc-4.2: No such file or directory

A symlink will sort out that issue:

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2

As one of the comments on this post states.

It might not be the best solution but it works, there's surely something else to it.

Community
  • 1
  • 1
  • 1
    The top-rated answer on that page links to yet another answer that explains you can actually download the command line tools from within XCode instead of having to download them from the link you gave. Here's a link to that answer directly, with instructions: http://stackoverflow.com/questions/11494522/installing-make-on-mac/11494872#11494872 I did have to create a symlink for gcc after doing this. – carpeliam Sep 16 '12 at 06:51
  • I downloaded the command line tools from developer.apple.com and then needed the symlink that you suggested. – Steph Rose Oct 28 '12 at 12:14
5

I had the same problems after a Time Machine update. Installing Xcode and the along coming developer tools fixed that issue.

  • Forgot about that one... I installed Xcode 3.2.6 and it worked fine. Thanks! – robertwbradford Jul 11 '11 at 16:08
  • if XCode is already installed and you are still having this problem, see the note below by carpeliam. (he links to this answer which resolves the problem using XCode: http://stackoverflow.com/questions/11494522/installing-make-on-mac/11494872#11494872) – gymbrall Jul 27 '13 at 19:13
4

If you have Mountain Lion and XCODE 4.4.1 you have to go here https://developer.apple.com/downloads/index.action and download the command line tool (it's free so you don't have to pay for iOS or MAC developer program) to download this tool.

It works for me.

Jean
  • 5,201
  • 11
  • 51
  • 87
3

FYI, you need to run the "Install Xcode" app if you downloaded it from the Appstore on a Lion in order to finish the install. Seems silly, but I missed it.

Randito
  • 43
  • 4
2

You simply need to install make!

RHEL-based:

yum install make

Debian-based

apt-get install make

Alastair
  • 6,837
  • 4
  • 35
  • 29
0

I had the same problem after upgrading to OS X Lion. I updated X Code to 4.1 and everything was better!

Andrew
  • 171
  • 1
  • 10