在Mavericks上安装Rails [英] Installing Rails on Mavericks
问题描述
不知道发生了什么,但是当我升级到Mavericks时,它说没有安装Rails.我执行了以下命令:
Not sure what happened but when I upgraded to Mavericks it says that Rails it not install. I executed the following command:
rails --version
它说当前未安装滑轨并运行sudo gem install rails".
And it said "Rails is not currently installed and run sudo gem install rails".
我运行sudo gem install rails并获得以下信息:
I run sudo gem install rails and get the following:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection.
更新:
我运行命令gcc --version并得到以下内容:
I ran the command gcc --version and got the following:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
推荐答案
您需要安装命令行开发人员工具.只需打开终端并键入需要它的命令-例如git
,gcc
或make
.或使用以下命令:
You need to install the Command Line Developer Tools. Just open Terminal and type up a command that requires it -- for instance, git
, gcc
or make
. Or use the following command:
$ xcode-select --install
您会看到这样的警报:
只需单击安装"即可. 从OS X 10.9开始,不再需要安装Xcode 进行Ruby开发.
Just click Install and that's it. As of OS X 10.9, there's no longer need to install Xcode for Ruby development.
有关步骤和图片的信息,请发给Daniel Kehoe的最新指南: http://railsapps.github.io/installrubyonrails-mac.html
Credit for the steps and picture goes to Daniel Kehoe in his latest guide: http://railsapps.github.io/installrubyonrails-mac.html
这篇关于在Mavericks上安装Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!