Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sh: make: command not found" when running "$ bundle" after adding redcarpet gem to Rails app

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/[email protected]/gems/redcarpet-1.17.2 for inspection.
Results logged to /Users/robs/.rvm/gems/[email protected]/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/[email protected]/bin/bundle:19:in `load'
from /Users/robs/.rvm/gems/[email protected]/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.

like image 205
robertwbradford Avatar asked Jul 01 '11 16:07

robertwbradford


2 Answers

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.

like image 114
Darío Javier Cravero Avatar answered Oct 13 '22 19:10

Darío Javier Cravero


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

like image 36
Muhammad Härter Avatar answered Oct 13 '22 19:10

Muhammad Härter