简体   繁体   English

无法在我的全新Mac OS X Lion 10.7.3上安装rails

[英]Cant install rails on my brand new Mac OS X Lion 10.7.3

Just got a new macbook pro and im having troubles installing rails.. I got ruby 1.8.7 already installed and when i try to write 'gem install rails' i get: 刚刚得到一个新的macbook pro和我有安装rails的麻烦..我已经安装了ruby 1.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.

I also tried to install a higher version of ruby and it said: 我还尝试安装更高版本的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

PLEASE help me, i used windows before and also pretty new to rails, so i dont know much about which path should i direct my terminal. 请帮助我,我之前使用的是Windows,也是铁杆的新手,所以我不知道应该指向哪个路径我的终端。 i need a step by step explanation to put rails up and standing on my mac. 我需要一步一步的解释,把铁轨放在我的Mac上。

Thanks so much! 非常感谢! Nir 尼尔

Your use of RVM looks a lot like you don't have the developer tools installed. 您对RVM的使用看起来很像您没有安装开发人员工具。 Grab XCode from the App Store, the install the command line tools! 从App Store获取XCode,安装命令行工具!

If you really want to install rails on the platform-provided ruby, all you need to do is to sudo gem install rails , for you need to use administrator privileges to isntall gems in the system gemset. 如果你真的想在平台提供的ruby上安装rails,你需要做的就是sudo gem install rails ,因为你需要使用管理员权限来处理系统gemset中的gent。

This tutorial helped me install on mac before with OS X 10.6 (I believe). 在使用OS X 10.6之前, 本教程帮助我在Mac上安装(我相信)。 The only thing that was a trouble was the C compiler, which I figured out was the problem from looking up one of the errors. 唯一出现问题的是C编译器,我发现这是查找其中一个错误的问题。

Probably you will find by looking up the output Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log by typing vi /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log type esc key followed by typing :q! 可能你会发现通过查找Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log的输出Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log输入Error running 'make ', please read /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log ,输入vi /Users/nirohayon/.rvm/log/ruby-1.9.3-p125/yaml/make.log键入esc键,然后键入:q! to quit. 退出。

As previous answer suggested, you need to get a compiler. 如前面的答案所示,您需要获得一个编译器。 I don't know about Xcode specifics, but I tracked down an installer for GCC compiler for Mac on Github I believe but it is probably better straight from Apple packages, ( tutorial here ) 我不知道Xcode的具体细节,但是我在Github上找到了Mac上GCC编译器的安装程序我相信但是它可能更直接来自Apple软件包,( 这里的教程

Also note that if you end up having to use sudo at all, you've probably gone off-track from the guide to install RVM on your system. 另请注意,如果您最终不得不使用sudo ,那么您可能已经偏离指南在系统上安装RVM。 In which case your path will be somewhere other than in the home directory and the instruction to adjust your source with echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile will not work. 在这种情况下,您的路径将位于主目录以外的某个位置以及使用echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile来调整源的指令echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile将不起作用。 Which may end up being somewhere like "/usr/local/rvm/scripts/rvm" 这可能最终会像"/usr/local/rvm/scripts/rvm"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM