在Mac OS X 10.7.3上安装Ruby on Rails的新手

时间:2012-03-13 06:31:50

标签: ruby-on-rails ruby macos installation rvm

我是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

1 个答案:

答案 0 :(得分:2)

您没有安装任何编译器,您的最佳选择是osx-gcc-installer,它将为您提供编译所需的所有工具。

另外请确保不要使用4.1以上的Xcode - 它不提供GCC编译器(仅限LLVM),甚至ruby-1.9.3-p125还没有为clang(LLVM)做好充分的准备,所以期待它的错误。

你可以open a ticket修复信息以提供更多信息 - 我应该能够改进它。