【问题标题】:gem install psych error宝石安装心理错误
【发布时间】:2013-02-20 17:55:01
【问题描述】:

我正在尝试捆绑安装一个 rails 项目,但我被卡住了... 当我尝试运行gem install psych 时,我得到的只是:

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

        /Users/gibatronic/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for yaml.h... no
yaml.h is missing. Try 'port install libyaml +universal' or 'yum install libyaml-devel'
*** 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/gibatronic/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
    --with-libyaml-dir
    --without-libyaml-dir
    --with-libyaml-include
    --without-libyaml-include=${libyaml-dir}/include
    --with-libyaml-lib
    --without-libyaml-lib=${libyaml-dir}/lib


Gem files will remain installed in /Users/gibatronic/.rvm/gems/ruby-1.9.3-p327/gems/psych-1.3.4 for inspection.
Results logged to /Users/gibatronic/.rvm/gems/ruby-1.9.3-p327/gems/psych-1.3.4/ext/psych/gem_make.out

我在 OS X 10.8.2 上运行 ruby 1.9.3p327rails 3.2.12

我已经安装了libyaml 0.1.4rvm pkg install libyaml

我真的不知道该怎么办了!

【问题讨论】:

  • 它正在寻找 libyaml-devel 库,尝试按照错误消息中的建议进行安装
  • 我想@bernabas 但似乎 libyaml-devel 甚至不存在!
  • 这对我有用port install libyaml +universal@gibatronic
  • 耶!谢谢@bernabas!我不知道 MacPorts……现在我通过它安装了 libyaml,我终于可以安装 pysch gem!
  • 不客气 :) @gibatronic

标签: ruby-on-rails psych


【解决方案1】:
apt-get install libyaml-dev

在基于 Debian 7 的系统下运行的情况下进行了修复(对于 Ubuntu 可能相同)

【讨论】:

    【解决方案2】:

    安装 libyaml

    port install libyaml +universal
    

    【讨论】:

      【解决方案3】:

      就我而言,我必须设置 CFLAGS 和 LDFLAGS 变量:

      # ensure libyaml is installed
      port install libyaml +universal
      
      # if you like you can check the location of the installied files (especially the .h file)
      # port contents libyaml
      
      # now configure with these options
      CFLAGS="-I/opt/local/include/ "  LDFLAGS="-L/opt/local/lib/" ./configure
      make
      sudo make install
      

      【讨论】:

        猜你喜欢
        • 2014-11-08
        • 2011-05-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多