V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zeroday
V2EX  ›  问与答

安装 gollum 出错

  •  
  •   zeroday · 2014-03-28 16:14:06 +08:00 · 4287 次点击
    这是一个创建于 3882 天前的主题,其中的信息可能已经有所发展或是发生改变。
    参考的安装方法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 <[email protected]>;, Michal Papis <[email protected]>; [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
    3 条回复    2014-07-09 22:09:23 +08:00
    zeroday
        1
    zeroday  
    OP
       2014-03-30 01:12:45 +08:00
    问题解决,结果是编译器的问题。重新安装了GCC
    xi_lin
        2
    xi_lin  
       2014-07-09 18:50:38 +08:00
    @zeroday 安装的是什么版本的GCC吗?
    zeroday
        3
    zeroday  
    OP
       2014-07-09 22:09:23 +08:00
    @xi_lin brew install gcc47
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1056 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:39 · PVG 03:39 · LAX 11:39 · JFK 14:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.