我对OS X和RoR很陌生,在学习Hartl的RoR教程时遇到了一些错误。
我已经安装了Git和RVM,但是在安装Ruby时出现了错误,因此也无法安装Ruby Gems和Rails。
我已经阅读了日志文件,但无法找出问题所在…似乎我的机器无法运行make,并且有--version的问题有些文件也不存在。
非常感谢您的帮助:)
User-MacBook-Air:~ haseebjaved$ rvm install 1.9.2
Fetching yaml-0.1.4.tar.gz to /Users/haseebjaved/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/haseebjaved/.rvm/src
Configuring yaml in /Users/haseebjaved/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/haseebjaved/.rvm/usr" ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/yaml/configure.log
Compiling yaml in /Users/haseebjaved/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/yaml/make.log
Database file /Users/haseebjaved/.rvm/config/packages does not exist.
/Users/haseebjaved/.rvm/scripts/functions/build: line 28: --version: command not found
Installing Ruby from source to: /Users/haseebjaved/.rvm/rubies/ruby-1.9.2-p318, this may take a while depending on your cpu(s)...
ruby-1.9.2-p318 - #fetching
ruby-1.9.2-p318 - #extracted to /Users/haseebjaved/.rvm/src/ruby-1.9.2-p318 (already extracted)
ruby-1.9.2-p318 - #configuring
Error running ' ./configure --prefix=/Users/haseebjaved/.rvm/rubies/ruby-1.9.2-p318 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/haseebjaved/.rvm/usr ', please read /Users/haseebjaved/.rvm/log/ruby-1.9.2-p318/configure.log
There has been an error while running configure. Halting the installation.
/Users/haseebjaved/.rvm/scripts/functions/build: line 28: --version: command not found
最佳答案
您没有安装任何编译器,您的最佳选择是osx-gcc-installer,它将为您提供编译所需的所有工具。
另外,请确保不要使用高于4.1的xcode——它不提供gcc编译器(仅llvm),甚至ruby-1.9.3-p125也没有完全准备好进行clang(llvm),所以请期待它出现错误。
你可以open a ticket来修正msg,使其更具信息性-我应该能够改进它。