使用gem安装rails失败

雪城无月 2015-05-09 10:31:21
最近新败了一台mbp,打算学习一下ror,就去安装一些ror的环境来搞一下,然后安装了brew,rvm,使用rvm安装了ruby-1.9.3
结果在使用新安装的gem来安装rails的时候,就悲剧了,死活装不了,这是返回的错误:
Fetching: rack-1.6.0.gem (100%)
Successfully installed rack-1.6.0
Fetching: rack-test-0.6.3.gem (100%)
Successfully installed rack-test-0.6.3
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

/Users/panerai/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20150509-18953-vlw9j5.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.

To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions. If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
-----
*** 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
--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/panerai/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build

extconf failed, exit code 1

Gem files will remain installed in /Users/panerai/.rvm/gems/ruby-1.9.3-p551/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Users/panerai/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-14/1.9.1/nokogiri-1.6.6.2/gem_make.out

麻烦各位大侠指点一下
PS:可以邀请人真的很赞
...全文
967 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
雪城无月 2015-05-09
  • 打赏
  • 举报
回复
终结此贴,竟然是因为没有装Command Line Tools导致的,装了xcode竟然还有另外装这个,哭了

2,763

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ruby/Rails
社区管理员
  • Ruby/Rails社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧