2014-03-26 74 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