安装 Ruby 和 Rails 开发环境
最近开始学习ruby on rails,为自己的学习记录一下。
安装
系统:OS X 10.8
根据http://ruby-china.org/wiki/install_ruby_guide 安装即可。
不过可能会出现问题。
在安装rails时,如果出现如下错误, 可以打开xCode,依次打开xCode->Preferences, 选择Download tab, 安装Command Line Tools即可。
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.5 for inspection.
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.7.5 for inspection.