097320047d33902f28d29920370df1b0

安裝Rails環境錯誤

killtw新手 節點 中發起
最後由 killtw回應 , 629次閱讀

昨天想說把Mac整個洗白清乾淨,但沒想到在安裝Rails的過程中困難重重
遇到不少問題

從頭到尾都照著 @xditeRails 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 readrvm 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

截至 ,共收到 7 條回應
888339de9e7a88688b6acb30d33e66cd
elct9620 1樓, 於回應

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

19e786a2a74377ff6e052d87fd8d1fa8
xdite 2樓, 於回應

http://developer.apple.com/downloads/index.action 找 Command Line Tools for Xcode
裝這個看看

19e786a2a74377ff6e052d87fd8d1fa8
xdite 3樓, 於回應

要註冊為 developer 才能看到

097320047d33902f28d29920370df1b0
killtw 4樓, 於回應

Command Line Tools for Xcode解決了大部分的問題
現在只剩下 homebrew.mxcl.mysql.plist-bash: /Users/killtw/.profile: No such file or directory

888339de9e7a88688b6acb30d33e66cd
elct9620 5樓, 於回應

~/.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/
(這篇文章有解釋到你的問題,試試看)

36b1f565fc83d9b67588123f2171b896
chitsaou 6樓, 於回應

我昨天自己編譯了 GCC 4.6 來 install Ruby 1.9.2 ... Orz

097320047d33902f28d29920370df1b0
killtw 7樓, 於回應

@elct9620 感謝解答,問題都解決了

需要 登入 後方可回應,如果你還沒有帳號按這裡 註冊