"sh:make:未找到命令"在为Rails应用程序添加Redcarpet Gem后运行"$捆绑"[英] "sh: make: command not found" when running "$ bundle" after adding redcarpet gem to Rails app

本文是小编为大家收集整理的关于"sh:make:未找到命令"在为Rails应用程序添加Redcarpet Gem后运行"$捆绑"的处理方法,想解了"sh:make:未找到命令"在为Rails应用程序添加Redcarpet Gem后运行"$捆绑"的问题怎么解决?"sh:make:未找到命令"在为Rails应用程序添加Redcarpet Gem后运行"$捆绑"问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

在向Gemfile添加"Gem'Redcarpet"后,我在运行"$捆绑"后获得以下内容:

$ 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>'

完整的gist在这里.

我正在使用不同的Gemsets的RVM.此应用程序正在使用@ Rails-3.0 Gemset. 这是我之前的问题.

我注意到"安装redcarpet(1.17.2)......"行包括"/users/robs/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9. 1 /rubygems/installer.rb".这是问题的一部分吗?我怎样才能达到安装?

谢谢.

推荐答案

我在时间机器更新后具有相同的问题.安装Xcode和沿着即将到来的开发人员工具修复了该问题.

其他推荐答案

在更新到山狮后相同的问题.您需要获取新命令行工具并运行:

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

src:升级到山狮和xcode 4打破了"make"?

如果在此之后,您仍然会收到这样的错误:

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

一个symlink将解决问题:

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

作为这个帖子状态.

它可能不是最好的解决方案,但它有效,肯定有其他事情.

其他推荐答案

如果您有山狮和Xcode 4.4.1您必须进入 https://developer.apple.com/downloads/index.action 并下载命令行工具(它是免费的,所以您不必支付iOS或Mac开发人员程序)以下载此工具.

它适合我.

本文地址:https://www.itbaoku.cn/post/786488.html