安装 gollum 出错

2014-03-28 16:14:06 +08:00
 zeroday
参考的安装方法http://www.yangzhiping.com/tech/gollum.html

新建Gemfile文件,内容如下:

source "http://rubygems.org"
gem 'redcarpet'
gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d'
gem 'gollum',git: 'https://github.com/gollum/gollum.git'
运行:

bundle install

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/alex/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for main() in -licui18n... *** 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/alex/.rvm/rubies/ruby-2.1.1/bin/ruby
--with-icu-dir
--without-icu-dir
--with-icu-include
--without-icu-include=${icu-dir}/include
--with-icu-lib
--without-icu-lib=${icu-dir}/lib
--with-icui18nlib
--without-icui18nlib
/Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:742:in `try_func'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:973:in `block in have_library'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:968:in `have_library'
from extconf.rb:27:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/alex/.rvm/gems/ruby-2.1.1/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /Users/alex/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out
An error occurred while installing charlock_holmes (0.6.9.4), and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.6.9.4'` succeeds before bundling.

运行 `gem install charlock_holmes -v '0.6.9.4'`

Building native extensions. This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.

/Users/alex/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for main() in -licui18n... *** 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/alex/.rvm/rubies/ruby-2.1.1/bin/ruby
--with-icu-dir
--without-icu-dir
--with-icu-include
--without-icu-include=${icu-dir}/include
--with-icu-lib
--without-icu-lib=${icu-dir}/lib
--with-icui18nlib
--without-icui18nlib
/Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:742:in `try_func'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:973:in `block in have_library'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /Users/alex/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/mkmf.rb:968:in `have_library'
from extconf.rb:27:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/alex/.rvm/gems/ruby-2.1.1/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /Users/alex/.rvm/gems/ruby-2.1.1/extensions/x86_64-darwin-12/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out

环境是
rvm 1.25.22 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
gem -version 2.2.2
Bundler version 1.5.3
Rails 4.0.4
4293 次点击
所在节点    问与答
3 条回复
zeroday
2014-03-30 01:12:45 +08:00
问题解决,结果是编译器的问题。重新安装了GCC
xi_lin
2014-07-09 18:50:38 +08:00
@zeroday 安装的是什么版本的GCC吗?
zeroday
2014-07-09 22:09:23 +08:00
@xi_lin brew install gcc47

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/106294

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX