簡體   English   中英

在新的Mac上安裝Rails

[英]Installing Rails on new mac

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

$ 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上安裝Rails時出現此錯誤

$ 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

我已經嘗試解除Atomic gem的安裝並重新安裝,這是由XCode 5.1引起的。

如錯誤消息所述,

  • 在繼續之前,請確保brew update工作正常
  • 之后,沒有附加標志的純rvm install 1.9.3應該可以工作
  • 對於RVM,請不要在gem命令中使用sudo ,因為它將使用系統RubyGems
  • 只是gem install rails現在也應該可以使用
  • 如果您想使用系統Ruby,那么在Mavericks中似乎有問題。 您可以在此處找到解決方案: New Rails Project:“捆綁安裝”無法在gemfile中安裝rails

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM