我的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
Run Code Online (Sandbox Code Playgroud)
谁能告诉我错误在哪里?
Gus*_*ter 14
我正在使用Mac El Capitan.在我的情况下,它是由缺少的开发人员工具引起的.我通过安装开发人员工具来解决它xcode-select --install.之后,捆绑安装再次正常工作.
ski*_*m55 12
错误发生在mkmf.log文件中.该文件应位于/home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46/ext/linecache/mkmf.log.
如果没有,你可以使用
sudo find / -name mkmf.log
Run Code Online (Sandbox Code Playgroud)
找到它.
要进一步排除故障,请参阅" 如何使用mkmf.log安装Nokogiri Ruby gem,说没有找到libiconv? "
ken*_*orb 10
您很可能遗漏了一些文件头(例如zlib或libiconv),因此请尝试安装它们.
Linux的: sudo apt-get install libz-dev libiconv-hook1 libiconv-hook-dev
OS X: brew install libiconv && xcode-select --install
否则,请检查mkmf.log文件以获取更多具体细节.
小智 8
我在运行 MacOS Big Sur 版本 11.1 和 Xcode 版本 12.4 (12D4e) 时遇到了同样的问题。就我而言,Xcode 中没有选择命令行工具。
\n我只是按照以下步骤解决了该问题:
\nsudo gem install cocoapods(以我为例)。这似乎是与海湾合作委员会的权限的问题.但是,如果你使用的OS X,你可能会遇到这个问题,如果你已经更新您的Xcode,但还没有同意他们的条款和条件尚未..尝试输入gcc在你的终端会告诉你如果你同意了.