本文介绍了尝试运行Octopress的捆绑软件安装时出现RedCloth makefile错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从Git(github.com/imathis/octopress.git octopress)将Octopress下载到本地机器,但是当我尝试按照说明运行软件包安装时,()我得到一个make错误。我正在运行Xcode 3.2版 - 我需要从Apple Developer网站升级到4.x吗?



我还运行Ruby 1.9.2p180 RVM。我需要运行一个更新的版本吗?



当我尝试运行sudo gem install RedCloth时,输出如下:

 构建原生扩展。这可能需要一段时间... 
错误:安装RedCloth时出错:

错误:无法构建gem原生扩展。

/Users/user/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
检查main()in -lc ... extconf.rb失败
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:

--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include = $ {opt-dir} / include
--with-opt-lib
--without-opt-lib = $ {opt-dir} / lib
--with-make-prog
--without-make-prog
--srcdir =。
--curdir
--ruby = / Users / user / .rvm / rubies / ruby​​-1.9.2-p180 / bin / ruby​​
--with-redcloth_scan-dir
--without-redcloth_scan-dir
--with-redcloth_scan-include
--without-redcloth_scan-include = $ {redcloth_scan-dir} / include
--with-redcloth_scan-lib
--without-redcloth_scan-lib = $ {redcloth_scan-dir} / lib
--with-clib
--without-clib
/Users/user/.rvm/ rubies / ruby​​-1.9.2-p180 / lib / ruby​​ / 1.9.1 / mkmf.rb:368:在`try_do'中:
编译器未能生成可执行文件。 (RuntimeError)您必须先安装
开发工具。

from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in`try_link0'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in`try_link'
from /Users/user/.rvm/rubies /ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:552:in`try_func'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/ lib / ruby​​ / 1.9.1 / mkmf.rb:748:位于
中的`block中has_library'$ / b $ b from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby /1.9.1/mkmf.rb:693:in`block in
checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9。 1 / mkmf.rb:280:在`block(2
levels)中推迟'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9 .1 / mkmf.rb:254:在`open'中
来自/Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:在
中的block中,从/Users/user/.rvm/rubies-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in`后面延迟'
'open '来自/Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276的
:从`/Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in
``checking_for'$推迟
b / b from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:743:in
`have_library'
from extconf .rb:5:在< main>'
Gem文件将保持安装在/Users/user/.rvm/gems/ruby-1.9.2-p180/gems/RedCloth-
4.2。 8检查。
结果记录到/Users/user/.rvm/gems/ruby-1.9.2-p180/gems/RedCloth-
4.2.8 / ext / redcloth_scan / gem_make.out
code>


解决方案

这为我修正了错误。

  sudo apt-get install ruby​​1.9.1-full 
sudo update-alternatives --config ruby​​

似乎错误是由于某些ruby1.9.1-dev构建文件/配置丢失导致的)

I've just pulled down Octopress from Git ( github.com/imathis/octopress.git octopress ) to my local machine, but when I try to run bundle install per the instructions, ( http://octopress.org/docs/setup/ ) I get a make error. I'm running version 3.2 of Xcode--do I need to update to 4.x from the Apple Developer site?

I'm also running Ruby 1.9.2p180 per RVM. Do I need to run a more recent version?

Here's the output when I try to run sudo gem install RedCloth:

Building native extensions. This could take a while...
ERROR: Error installing RedCloth:

ERROR: Failed to build gem native extension.

/Users/user/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for main() in -lc... extconf.rb failed
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:

--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/user/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
--with-redcloth_scan-dir
--without-redcloth_scan-dir
--with-redcloth_scan-include
--without-redcloth_scan-include=${redcloth_scan-dir}/include
--with-redcloth_scan-lib
--without-redcloth_scan-lib=${redcloth_scan-dir}/lib
--with-clib
--without-clib
/Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The
complier failed to generate an executable file. (RuntimeError) You have to install
development tools first.

from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:748:in `block in
have_library'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in
checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2
levels) in postpone'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in
postpone'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in
`checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:743:in
`have_library'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.2-p180/gems/RedCloth-
4.2.8 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.2-p180/gems/RedCloth-
4.2.8/ext/redcloth_scan/gem_make.out
解决方案

this fixed the error for me..

sudo apt-get install ruby1.9.1-full
sudo update-alternatives --config ruby

(it seems the error is caused when some of the ruby1.9.1-dev build files/config are missing)

这篇关于尝试运行Octopress的捆绑软件安装时出现RedCloth makefile错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 20:46