2013-06-29 75 views
6

嘗試安裝rails(或更具體地說,原子)時出現錯誤。安裝Ruby on Rails 4.0時出錯 - atomic_reference.c錯誤71

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

    /Users/dima/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb creating Makefile 

make compiling atomic_reference.c atomic_reference.c:50:9: warning: implicit declaration of function 'OSAtomicCompareAndSwap64' is invalid in C99 [-Wimplicit-function-declaration] 
    if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) { 
     ^1 warning generated. linking shared-object atomic_reference.bundle 

make install /usr/bin/install -c -m 0755 atomic_reference.bundle /Users/dima/.rvm/gems/[email protected]_rails_4_0/gems/atomic-1.1.10/lib/Users/dima/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/x86_64-darwin12.4.0 install: /Users/dima/.rvm/gems/[email protected]_rails_4_0/gems/atomic-1.1.10/lib/Users/dima/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/x86_64-darwin12.4.0: No such file or directory make: *** [install-so] Error 71 


Gem files will remain installed in /Users/dima/.rvm/gems/[email protected]_rails_4_0/gems/atomic-1.1.10 for inspection. Results logged to /Users/dima/.rvm/gems/[email protected]_rails_4_0/gems/atomic-1.1.10/ext/gem_make.out 

我基本上只是下面的導軌教程(鋼軌4.0和Ruby 2.0,seen here),並那種碰了壁在這裏,不幸的是,無法找到這裏發生了什麼很多信息。

我找到了this question,並在結果中回答了兩個建議。

+0

你在使用什麼操作系統?編輯:我假設你正在通過你的主目錄路徑使用OSX。您是否安裝了XCode和XCode命令行界面? –

+0

我在OSX上,我安裝了Xcode和CLI。 – Dima

回答

14

有同樣的問題,來自相同的教程。得到它的工作以下this post。跑了幾個命令後比較gemsets但似乎什麼來解決這個問題是

  • 寶石更新--system(未經教程「2.0.0」,更新我2.0.3)
  • 寶石更新
  • 創業板安裝導軌(同樣沒有指定版本)

最後它正確安裝

+0

'gem update --system'終於搞定了。謝謝! – Dima

+0

仍有此問題 –

0

所以,在我的情況似乎是失敗的是,Makefile有一個INSTALL = /安裝和th ere不是./install。我編輯的Makefile中取出./然後創建一個本地規範與

gem spec ../../../cache/atomic-1.1.14.gem --ruby > ../../../specifications/atomic-1.1.14.gemspec 

隨後

gem install rails 

成功了,但不知道如果這搞砸了我的rails實例。