Mac上RoR环境搭建问题
昨天一晚上折磨的我啊都快疯掉了。
按照http://railstutorial-china.org方法配制,到rvm requirements这个命令执行时就麻烦事来了。
WutekiMacBook-Pro:~ wuxj$ rvm requirements Checking requirements for osx. Error: No available formula for gcc46 Installing requirements for osx. Updating system....... Error running 'requirements_osx_brew_update_system ', showing last 15 lines of /Users/wuxj/.rvm/log/1409358409/update_system.log https://github.com/Homebrew/homebrew/wiki/Common-Issues and make sure `brew update` works before continuing.' + rvm_pretty_print stderr + case "${rvm_pretty_print_flag:=auto}" in + case "${TERM:-dumb}" in + case "$1" in + [[ -t 2 ]] + return 1 + printf %b 'Failed to update Homebrew, follow instructions here: https://github.com/Homebrew/homebrew/wiki/Common-Issues and make sure `brew update` works before continuing. ' Failed to update Homebrew, follow instructions here: https://github.com/Homebrew/homebrew/wiki/Common-Issues and make sure `brew update` works before continuing. + return 1 Requirements installation failed with status: 1.
开始以为是Homebrew没更新,所以执行了下brew update,结果:
WutekiMacBook-Pro:~ wuxj$ brew update error: The following untracked working tree files would be overwritten by merge: Library/Formula/ant.rb Library/Formula/libarchive.rb Please move or remove them before you can merge. Aborting Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
执行了下brew doctor
WutekiMacBook-Pro:~ wuxj$ brew doctor Warning: Some directories in your path end in a slash. Directories in your path should not end in a slash. This can break other doctor checks. The following directories should be edited: /Users/wuxj/Downloads/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/ Error: Homebrew doesn't know what compiler versions ship with your version of Xcode (5.1.1). Please `brew update` and if that doesn't help, file an issue with the output of `brew --config`: https://github.com/mxcl/homebrew/issues Thanks!
执行bundle
。 。 。 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /Users/wuxj/.rvm/rubies/ruby-2.1.2/bin/ruby -r ./siteconf20140830-1163-1hd6znq.rb extconf.rb Building nokogiri using packaged libraries. ----- libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. ----- *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/wuxj/.rvm/rubies/ruby-2.1.2/bin/ruby --help --clean --use-system-libraries --enable-static --disable-static --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --enable-cross-build --disable-cross-build extconf failed, exit code 1 Gem files will remain installed in /Users/wuxj/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.3.1 for inspection. Results logged to /Users/wuxj/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3.1/gem_make.out An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.
依然不行,执行 gem install nokogiri -v '1.6.3.1' , 还是不行。
WutekiMacBook-Pro:sample_app wuxj$ gem install nokogiri Building native extensions. This could take a while... Building nokogiri using packaged libraries. ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /Users/wuxj/.rvm/rubies/ruby-2.1.2/bin/ruby -r ./siteconf20140830-1261-1vvz386.rb extconf.rb Building nokogiri using packaged libraries. ----- libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. ----- *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/wuxj/.rvm/rubies/ruby-2.1.2/bin/ruby --help --clean --use-system-libraries --enable-static --disable-static --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --enable-cross-build --disable-cross-build extconf failed, exit code 1 Gem files will remain installed in /Users/wuxj/.rvm/gems/ruby-2.1.2/gems/nokogiri-1.6.3.1 for inspection. Results logged to /Users/wuxj/.rvm/gems/ruby-2.1.2/extensions/x86_64-darwin-13/2.1.0-static/nokogiri-1.6.3.1/gem_make.out
最后,在*上找到个大神解救了我。就是各种brew安装啊。。。
brew install autoconf brew install automake brew install libtool brew install ap
ple-gcc42 brew install libyaml brew install libxslt brew install libksba brew install openssl
结果
WutekiMacBook-Pro:sample_app wuxj$ rvm requirements Checking requirements for osx. Updating certificates in '/usr/local/etc/openssl/cert.pem'. Requirements installation successful.
终于解决了。