2014-03-26 71 views
0

我想在新機器上設置Rails,並在嘗試安裝Ruby 1.9.3時遇到此錯誤。在新的Mac上安裝Rails

$ rvm install 1.9.3 --with-gcc=clang 
Checking requirements for osx. 
Installing requirements for osx. 
Updating system..... 
Error running 'requirements_osx_brew_update_system ruby-1.9.3-p545', 
showing last 15 lines of /Users/mitchelld/.rvm/log/1395835654_ruby-1.9.3-p545/update_system.log 
https://github.com/mxcl/homebrew/wiki/Common-Issues 
and make sure `brew update` works before continuing.' 
++ 1395835655.N /scripts/functions/logging : rvm_error() 1 > rvm_pretty_print stderr 
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print() 73 > case "${rvm_pretty_print_flag:=auto}" in 
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print() 78 > case "${TERM:-dumb}" in 
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print() 81 > case "$1" in 
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print() 11 > [[ -t 2 ]] 
++ 1395835655.N /scripts/functions/logging : rvm_pretty_print() 11 > return 1 
++ 1395835655.N /scripts/functions/logging : rvm_error() 45 > printf %b 'Failed to update Homebrew, follow instructions here: 
https://github.com/mxcl/homebrew/wiki/Common-Issues 
and make sure `brew update` works before continuing.\n' 
Failed to update Homebrew, follow instructions here: 
https://github.com/mxcl/homebrew/wiki/Common-Issues 
and make sure `brew update` works before continuing. 
++ 1395835655.N /scripts/functions/requirements/osx_brew : requirements_osx_brew_update_system() 3return 1 
Requirements installation failed with status: 1. 

我想關於Ruby 2.0.0

$ sudo gem install rails 
Password: 
Building native extensions. This could take a while... 
ERROR: Error installing rails: 
ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for libkern/OSAtomic.h... yes 
creating Makefile 

make "DESTDIR=" clean 

make "DESTDIR=" 
compiling atomic_reference.c 
atomic_reference.c:57:59: warning: incompatible pointer types passing 'void **' to   parameter of type 'volatile int64_t *' (aka 'volatile long long *') [-Wincompatible-pointer-types] 
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) { 
                 ^~~~~~~~~~~~~~~ 
/usr/include/libkern/OSAtomic.h:507:93: note: passing argument to parameter '__theValue' here 
bool OSAtomicCompareAndSwap64(int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue); 
                         ^
1 warning generated. 
linking shared-object atomic_reference.bundle 
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line- argument-hard-error-in-future] 
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future 
make: *** [atomic_reference.bundle] Error 1 

make failed, exit code 2 

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.16 for inspection. 
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/atomic-1.1.16/gem_make.out 

安裝Rails我已經嘗試解除停止原子的寶石,並重新安裝,我發現這是由的XCode 5.1時引起這個錯誤信息。

+0

可能重複[紅寶石寶石安裝的Json對小牛和Xcode的5.1失敗 - 未知的說法:「-multiply \ _definedsuppress」(http://stackoverflow.com/questions/22352838 /紅寶石寶石安裝 - JSON - 失敗 - 對 - 小牛和 - xcode的-5-1-未知參數,MUL) – Nakilon

回答

0

隨着錯誤消息指出,

  • 確保brew update作品繼續後
  • 前平原rvm install 1.9.3無需額外的標誌應該工作
  • 與RVM,不要使用sudogem命令因爲它會使用系統RubyGems
  • 只是gem install rails現在也應該可以工作
  • 如果你喜歡使用Ruby系統,那麼小牛似乎有問題。您可能會在這裏找到一個解決方案:New Rails Project: 'bundle install' can't install rails in gemfile