昨天想說把Mac整個洗白清乾淨,但沒想到在安裝Rails的過程中困難重重
遇到不少問題
從頭到尾都照著 @xdite 的 Rails on Mac Best Practices 進行安裝
首先在安裝git的時候會遇到
Warning: Non-libraries were installed to "lib".
Installing non-libraries to "lib" is bad practice.
The offending files are:
/usr/local/Cellar/git/1.7.9.2/lib/Git.pm
接著在安裝Imagemagick以及mysql的時候會出現
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually
install mysql之後做
cp /usr/local/Cellar/mysql/5.5.19/com.mysql.mysqld.plist ~/Library/LaunchAgents/
的時候會提示
No such file or directory
必須改為 homebrew.mxcl.mysql.plist 才行
安裝完RVM之後進行
. ~/.profile
以及 source ~/.profile
會提示 -bash: /Users/killtw/.profile: No such file or directory
rvm install 1.9.2時會出現
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read
rvm requirements.
rvm install 1.9.3 --with-gcc=clang則是
Error running 'make ', please read /Users/killtw/.rvm/log/ruby-1.9.3-p125/make.log
There has been an error while running make. Halting the installation.
make.log的內容我放在http://gist.github.com/1999362
另外which cc的位置是在/usr/bin/cc
Ruby 1.9.2 已知在 MacOSX Lion 上會有問題。
不過 @XDite 大大的文章安裝的 osx-gcc-installer 好像就是去補足編譯器問題。
(但是我也爆掉,所以放棄,用 1.9.3 這樣)
然後我自己是有到 App Store 上先裝 XCode 下來(4.2 超肥,有 1.4 GB 裡面沒記錯會有蠻多編譯要的 lib)
Git 是上官網抓來安裝的,不是用 Homebrew
個人用 Homebrew 安裝 ImageMagick 時沒有碰到問題。
(requires these m4 macros, you'll need to add this path manually 似乎是說你需要自己新增這個路徑,手動加應該就沒事了@@)
MySQL 我用 MAMP 的就沒去裝了!
而 Ruby 1.9.3 我有裝成功,直接用 rvm install 1.9.3 就成功了這樣~
我也是新手,只能提供一下我的經驗Q^Q
http://developer.apple.com/downloads/index.action 找 Command Line Tools for Xcode
裝這個看看
要註冊為 developer 才能看到
Command Line Tools for Xcode解決了大部分的問題
現在只剩下 homebrew.mxcl.mysql.plist 跟 -bash: /Users/killtw/.profile: No such file or directory
~/.profile 問題自己建一個空檔案就可以了~
http://superuser.com/questions/1031/profile-in-mac-os-x
(應該用 touch ~/.profile 就可以建了)
mysql 那個我不知道是什麼 XDD
(如果裝不成 MySQL 我會偏向去官網下載或自己編譯)
http://www.erin-lawrence.com/ruby/2012/02/installing-mysqlrubyrails-on-mac-lion-with-homebrew/
(這篇文章有解釋到你的問題,試試看)
我昨天自己編譯了 GCC 4.6 來 install Ruby 1.9.2 ... Orz