2013-02-19 216 views
9

我試圖讓rails正常工作,並且無法通過binding_of_caller寶石,該寶石嘗試在運行sudo gem install rails後與其他寶石一起安裝。我不認爲這個gem是導軌工作所必需的,但不知道如何跳過它,或者阻止它嘗試安裝。gem install rails失敗bind_of_caller gem

每次寶石名單到達binding_of_callers我得到如下:

Installing binding_of_callers (0.6.9) with native extensions 

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
creating Makefile 

make 
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -O0 -std=c99  -c binding_of_caller.c 
binding_of_caller.c:4:10: fatal error: 'vm_core.h' file not found 
#include "vm_core.h" 
         ^ 
1 error generated. 
make: *** [binding_of_caller.o] Error 1 


Gem files will remain installed in /Users/ericavirtue/.bundler/tmp/54559/gems/binding_of_caller-0.6.9 for inspection. 
Results logged to /Users/ericavirtue/.bundler/tmp/54559/gems/binding_of_caller-0.6.9/ext/binding_of_caller/gem_make.out 
An error occurred while installing binding_of_caller (0.6.9), and Bundler cannot continue. 
Make sure that `gem install binding_of_caller -v '0.6.9'` succeeds before bundling. 

我運行OSX 10.8.2和使用POW Web服務器與rbenv管理紅寶石。我也跑紅寶石1.9.3-p385

回答

11

嘗試更新的寶石:

$ bundle update binding_of_caller

+4

。 – Arel 2013-02-27 23:05:42

+2

請注意,如果升級到Ruby 2.0時出現此錯誤,則此答案即爲答案。這是因爲你可能需要將binding_of_caller更新爲0.7.1。在這裏找到:http://www.gavinmorrice.com/blog/posts/37-ruby-2-0-0-an-error-occurred-while-installing-binding_of_caller – Taytay 2013-03-09 16:31:31

+0

你可能需要運行'bundle update'作爲一個整個..但是,這是方式。謝謝! – Tigraine 2013-06-26 19:30:27

-3

看起來像youre使用Linux。嘗試通過首先安裝ruby和rvm來遵循rails安裝。這可能是過時的紅寶石版本的原因。儘管在黑暗中。

+0

我正在運行OSX 10.8.2並使用rbenv的pow web服務器來管理ruby。我也運行紅寶石1.8.7 p-358。我完全迷失在這裏。我花了所有的下午/晚上試圖讓這個工作。我會用上面的信息更新問題,並嘗試更新我的紅寶石。 – Arel 2013-02-19 04:40:00

+0

我現在在使用ruby 1.9.3-p385。同樣的問題。這個問題據我所知是binding_of_caller,所以我相信解決方案包括跳過或刪除那個寶石,或者以某種方式解決上述問題。 – Arel 2013-02-19 05:27:35

+0

表示找不到vm_core.h。試試這個gem install ruby​​-debug19 - --with-ruby-include = $ rvm_path/src/ruby​​-1.9.3 -p385 – TakaGoto 2013-02-19 05:34:23

3

安裝滑軌之前,用下面的(也注意到,寶石名稱爲單數),加上創業板:

$ gem install binding_of_caller 

然後運行:

$ bundle update rails 

或者:

$ gem install rails 

(或任何rbenv報價)

+0

不幸的是我甚至無法得到那麼遠。每當我嘗試安裝gem時,都會收到錯誤消息。我會得到一些離線幫助,並在解決問題時發佈解決方案。 – Arel 2013-03-15 05:49:40

+0

您是否收到與原始文章中相同的錯誤消息? – Rich 2013-03-15 17:38:46

1

好了,問題是,如正在使用的項目紅寶石版本RBENV紅寶石版本不被認可。因此,在嘗試讓rbenv工作一段時間後,我切換回RVM進行了一些調試,並安裝了一些依賴項,安裝了ruby 2.0.0p0,並將其識別爲項目ruby。然後我能夠捆綁。所以要回答我的問題......這是一個紅寶石版本問題。

1

使用rbenv解決這個問題有什麼進展嗎?

我使用rbenv在本地加載jruby 2.0,我想繼續使用此解決方案而不是rvm。現在,根據所標註的答案

Ascended:Ascended foundation3 $ gem install binding_of_caller -v '0.7.2' 
Building native extensions. This could take a while... 
ERROR: Error installing binding_of_caller: 
     ERROR: Failed to build gem native extension. 

     /Users/Ascended/.rbenv/versions/jruby-1.7.4/bin/jruby extconf.rb 
/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/shared/mkmf.rb:1:in `(root)': Use RbConfig instead of obsolete and depreca 
ted Config. 
/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/shared/mkmf.rb:1791:in `init_mkmf': Use RbConfig instead of obsolete and deprecated Config. 
/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/shared/mkmf.rb:1791:in `init_mkmf': Use RbConfig instead of obsolete and $eprecated Config. 
creating Makefile 

make 
cc -I. -I/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/native/include -I/Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/nati$e/include/ruby -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -fPIC -DTARGET_RT_MAC_CFM=0 -fno-omit-frame-pointer -fno-strict-al$asing -fexceptions -O0 -std=c99 -arch x86_64 -c binding_of_caller.c 
binding_of_caller.c:4:10: fatal error: 'vm_core.h' file not found 
#include "vm_core.h" 
     ^
1 error generated. 
make: *** [binding_of_caller.o] Error 1 


Gem files will remain installed in /Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/binding_of_caller-0.7$2 for inspection. 
Results logged to /Users/Ascended/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/binding_of_caller-0.7.2/ext/binding_of$caller/gem_make.out 

-

Ascended:Ascended foundation3 $ rbenv local 
jruby-1.7.4 
Ascended:Ascended foundation3 $ jruby --version 
jruby 1.7.4 (2.0.0) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_51-b11-457-11M4509 [darwin-x86_64] 
Ascended:Ascended foundation3 $ gcc --version 
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) 
Copyright (C) 2007 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

我的〜/ .jrubyconf設置爲

compat.version=2.0                           
cext.enabled=true                
errno.backtrace=true 

,當我嘗試安裝來電者的結合,我得到以下在這個線程中正確,這是rbenv的一個問題,但jruby 1.7.4是正確的版本,它是在2.0下運行的。不應該這樣工作嗎?我不瞭解什麼?

+0

rbenv遇到的問題是它沒有爲我的環境加載適當版本的ruby。我會做命令來改變我的ruby版本,它不會採取。這個ruby問題最終成爲'binding_of_caller'不能創建的原因,也是我轉回到rvm的原因。如果'ruby -v'返回預期的紅寶石版本,我不確定你需要做什麼。 – Arel 2013-08-15 14:16:24

+0

好的,昨晚我無法讓它工作,所以我暫時停止使用pry-debugger,但是無法安裝像這樣的寶石,嚴重降低了ruby的內省能力,我需要一個工作很快。 – Theta 2013-08-15 18:08:27

+0

如果你這樣做,請張貼,我會給你複選標記,因爲我寧願回到使用rbenv。 – Arel 2013-08-15 18:12:10