且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试运行Octopress的捆绑软件安装时出现RedCloth makefile错误

更新时间:2022-12-07 08:11:30

这为我修正了错误。

  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)