简体   繁体   English

gem install rails在binding_of_caller gem失败

[英]gem install rails fails at binding_of_caller gem

I'm trying to get rails working and can't get past a binding_of_caller gem that tries to install with the other gems after running sudo gem install rails . 我正在尝试让rails工作,并且无法通过在运行sudo gem install rails之后尝试与其他gem安装的binding_of_caller gem。 I don't think the gem is required for rails to work, but can't figure out how to skip it, or stop it from trying to install. 我不认为gem需要rails才能工作,但是无法弄清楚如何跳过它,或者阻止它尝试安装。

Every time the list of gems gets to binding_of_callers I get the following: 每当宝石列表到达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.

I'm running OSX 10.8.2 and using pow web server with rbenv to manage ruby. 我正在运行OSX 10.8.2并使用带有rbenv的pow web服务器来管理ruby。 I'm also running ruby 1.9.3-p385 我也在运行ruby 1.9.3-p385

尝试更新gem:

$ bundle update binding_of_caller

Before installing Rails, add the gem with the following (also note that the gem name is singular): 在安装Rails之前,使用以下内容添加gem(还要注意gem名称是单数):

$ gem install binding_of_caller

Then run: 然后运行:

$ bundle update rails

Or: 要么:

$ gem install rails

(Or whatever rbenv offers) (或者无论rbenv提供什么)

Ok, so the problem was that the RBENV ruby version wasn't being recognized as the version of ruby being used by the project. 好吧,问题是RBENV ruby​​版本没有被识别为项目使用的ruby版本。 So after trying to get rbenv working for a while, I switched back to RVM went through some debugging, and installed some dependencies, I got ruby 2.0.0p0 installed, and recognized as the project ruby. 所以在尝试让rbenv工作了一段时间后,我切换回RVM进行了一些调试,并安装了一些依赖项,我安装了ruby 2.0.0p0,并将其识别为项目ruby。 Then I was able to bundle. 然后我就能捆绑了。 So to answer my question ... It was a ruby version issue. 所以回答我的问题......这是一个红宝石版本的问题。

Has there been any progress in solving this problem using rbenv? 使用rbenv解决这个问题有什么进展吗?

I'm using rbenv to load jruby 2.0 locally and I would like to continue using this solution rather than rvm. 我正在使用rbenv在本地加载jruby 2.0,我想继续使用这个解决方案而不是rvm。

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.

My ~/.jrubyconf is set to 我的〜/ .jrubyconf设置为

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

when I try to install binding of caller I get the following - 当我尝试安装调用者的绑定时,我得到以下 -

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

Now according to the answer that is marked correct in this thread, this is an issue with rbenv, but jruby 1.7.4 is the right version that is sourced and it is operating at 2.0. 现在根据在这个帖子中标记为正确的答案,这是rbenv的一个问题,但是jruby 1.7.4是正确的源代码版本,它运行在2.0。 Shouldn't this work? 这不应该工作吗? What am I not understanding? 我不明白的是什么?

Looks like youre using Linux. 看起来你正在使用Linux。 Try following the rails installation by installing ruby and rvm first. 首先安装ruby和rvm,尝试执行rails安装。 It might be cause of an outdated ruby version. 这可能是过时的红宝石版本的原因。 throw in the dark though. 尽管在黑暗中投掷。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM