簡體   English   中英

無法在我的全新Mac OS X Lion 10.7.3上安裝rails

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

剛剛得到一個新的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.

我還嘗試安裝更高版本的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,也是鐵桿的新手,所以我不知道應該指向哪個路徑我的終端。 我需要一步一步的解釋,把鐵軌放在我的Mac上。

非常感謝! 尼爾

您對RVM的使用看起來很像您沒有安裝開發人員工具。 從App Store獲取XCode,安裝命令行工具!

如果你真的想在平台提供的ruby上安裝rails,你需要做的就是sudo gem install rails ,因為你需要使用管理員權限來處理系統gemset中的gent。

在使用OS X 10.6之前, 本教程幫助我在Mac上安裝(我相信)。 唯一出現問題的是C編譯器,我發現這是查找其中一個錯誤的問題。

可能你會發現通過查找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! 退出。

如前面的答案所示,您需要獲得一個編譯器。 我不知道Xcode的具體細節,但是我在Github上找到了Mac上GCC編譯器的安裝程序我相信但是它可能更直接來自Apple軟件包,( 這里的教程

另請注意,如果您最終不得不使用sudo ,那么您可能已經偏離指南在系統上安裝RVM。 在這種情況下,您的路徑將位於主目錄以外的某個位置以及使用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將不起作用。 這可能最終會像"/usr/local/rvm/scripts/rvm"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM