gib*_*nic 7 ruby-on-rails psych
我正在尝试捆绑安装一个 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
Run Code Online (Sandbox Code Playgroud)
我ruby 1.9.3p327正在rails 3.2.12运行OS X 10.8.2
我已经安装libyaml 0.1.4了rvm pkg install libyaml
我真的不知道该怎么办了!
lui*_*son 11
apt-get install libyaml-dev
Run Code Online (Sandbox Code Playgroud)
在我的基于 Debian 7 的系统下运行的情况下进行了修复(对于 Ubuntu 可能也是如此)
苹果系统:
brew install libyaml
Run Code Online (Sandbox Code Playgroud)
它修复了我gem update在尝试解析 YAML 步骤时出现的错误。
小智 5
这对我有用:
sudo apt-get install libyaml-dev
Run Code Online (Sandbox Code Playgroud)
但我不知道为什么?可以解释一下这个命令的作用吗?