我的Rails是3.2.1.4
,Ruby是1.9.3p448
。
安装ruby-debug
时出现错误
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.
/home/hxh/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** 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=/home/hxh/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
Gem files will remain installed in /home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46 for inspection.
Results logged to /home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46/ext/gem_make.out
谁能告诉我错误在哪里?
发布于 2013-12-07 06:03:30
错误在mkmf.log文件中。该文件应该位于/home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46/ext/linecache/mkmf.log
。
如果不是,您可以使用
sudo find / -name mkmf.log
才能找到它。
要进一步排除故障,请参阅"How to install Nokogiri Ruby gem with mkmf.log saying libiconv not found?“
发布于 2016-03-10 11:57:30
我使用的是Mac El Capitan。在我的例子中,这是由于缺少开发人员工具造成的。我通过xcode-select --install
安装开发人员工具解决了这个问题。在此之后,捆绑包安装再次正常工作。
发布于 2016-07-09 09:15:05
您很可能缺少一些文件头(例如zlib或libiconv),因此请尝试安装它们。
Linux:sudo apt-get install libz-dev libiconv-hook1 libiconv-hook-dev
OS X:brew install libiconv && xcode-select --install
否则,请检查您的mkmf.log
文件以获取更具体的详细信息。
https://stackoverflow.com/questions/19697359
复制相似问题