Ruby on rails安装在我的mac上失败了

时间:2012-08-31 15:06:01

标签: ruby-on-rails ruby terminal

运行:

  • Mac OS X Lion 10.7.4
  • xCode版本4.4.1
  • Ruby 1.8.x
  • 酿造
  • RVM

我正在尝试在我的mac上的rails上安装ruby(以上是我的规格)。但它并没有像以前那样出现。我在网上尝试了几个教程,包括Stack Overflow。

我一试:

$ sudo gem install rails

我收到此错误:

ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

与Ruby 1.9.2相同

修改 安装ruby时出错

Peter-Corverss-MacBook-Pro:~ Beer$ rvm install ruby-1.9.2-p290
Fetching yaml-0.1.4.tar.gz to /Users/Beer/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Beer/.rvm/src
Configuring yaml in /Users/Beer/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/Beer/.rvm/usr', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/yaml/configure.log
Compiling yaml in /Users/Beer/.rvm/src/yaml-0.1.4.
Error running 'make', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/yaml/make.log
Installing Ruby from source to: /Users/Beer/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...

ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8604k  100 8604k    0     0   225k      0  0:00:38  0:00:38 --:--:--  202k
ruby-1.9.2-p290 - #extracting ruby-1.9.2-p290 to /Users/Beer/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #extracted to /Users/Beer/.rvm/src/ruby-1.9.2-p290
ruby-1.9.2-p290 - #configuring 
Error running './configure --prefix=/Users/Beer/.rvm/rubies/ruby-1.9.2-p290 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/Beer/.rvm/usr', please read /Users/Beer/.rvm/log/ruby-1.9.2-p290/configure.log
There has been an error while running configure. Halting the installation.

上面的代码有一些颜色(图像):

enter image description here

这是安装ruby的开始,我无法让它工作。

我真的尝试了,但我无法解决问题,希望有人可以帮助我。

1 个答案:

答案 0 :(得分:0)

是的,如果你在构建ruby时遇到问题,你可能需要Xcode的命令行实用程序。结帐:http://developer.apple.com/library/mac/#recipes/xcode_help-documentation_preferences/DownloadingandInstallingXcodeComponents/DownloadingandInstallingXcodeComponents.html

它位于偏好设置面板中,带有下载标签。

安装完毕后,重新打开终端,再次尝试通过rvm安装1.9.2。如果它还没有安装,请评论,我会看看我是否可以解决它。如果确实安装了,请尝试安装导轨和放大器。捆绑:

rvm use ruby-1.9.2 --default
gem install rails
gem install bundler

第一行会将您切换为1.9.2,并应将其设置为默认环境。