刚买了一台新的MacBook Pro,我在安装Rails时遇到了问题。
我已经安装了Ruby1.8.7,当我试图编写“gem install rails”时,我得到了:

ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.

我还试图安装一个更高版本的ruby,它说:
    Nirs-MacBook-Pro:~ nirohayon$ rvm install 1.9.3
Fetching yaml-0.1.4.tar.gz to /Users/nirohayon/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/nirohayon/.rvm/src
Configuring yaml in /Users/nirohayon/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/nirohayon/.rvm/usr"  ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/configure.log
Compiling yaml in /Users/nirohayon/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log


Database file /Users/nirohayon/.rvm/config/packages does not exist.

Installing Ruby from source to: /Users/nirohayon/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...

ruby-1.9.3-p125 - #fetching
ruby-1.9.3-p125 - #extracted to /Users/nirohayon/.rvm/src/ruby-1.9.3-p125 (already extracted)
ruby-1.9.3-p125 - #configuring
Error running ' ./configure --prefix=/Users/nirohayon/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/nirohayon/.rvm/usr ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.
ls: /Users/nirohayon/.rvm/rubies/*/bin/ruby: No such file or directory

请帮帮我,我以前用过windows,而且对rails还很陌生,所以我不太知道应该引导我的终端走哪条路。我需要一个循序渐进的解释,把扶手放在我的Mac上。
非常感谢!
近红外光谱

最佳答案

使用rvm看起来很像没有安装开发人员工具。从app store中获取xcode,安装命令行工具!
如果您真的想在ruby提供的平台上安装rails,您只需要sudo gem install rails,因为您需要使用管理员权限来访问系统gems集中的所有gems。

10-07 19:04
查看更多