10

我正在尝试让 rails 工作,并且无法通过binding_of_caller运行后尝试与其他 gem 一起安装的 gem sudo gem install rails。我不认为 gem 是 rails 工作所必需的,但不知道如何跳过它,或者阻止它尝试安装。

每次宝石列表到达时,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并使用带有 rbenv 的 pow Web 服务器来管理 ruby​​。我也在运行红宝石1.9.3-p385

4

5 回答 5

12

尝试更新 gem:

$ bundle update binding_of_caller

于 2013-02-26T06:15:22.400 回答
3

在安装 Rails 之前,使用以下内容添加 gem(还要注意 gem 名称是单数的):

$ gem install binding_of_caller

然后运行:

$ bundle update rails

或者:

$ gem install rails

(或任何 rbenv 提供)

于 2013-03-14T23:01:19.267 回答
1

Ok, so the problem was that the RBENV ruby version wasn't being recognized as the version of ruby being used by the project. 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. Then I was able to bundle. So to answer my question ... It was a ruby version issue.

于 2013-03-31T21:53:10.440 回答
1

使用 rbenv 解决这个问题有什么进展吗?

我正在使用 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.

我的 ~/.jrubyconf 设置为

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

当我尝试安装调用者绑定时,我得到以下信息 -

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

现在根据该线程中标记为正确的答案,这是 rbenv 的问题,但 jruby 1.7.4 是正确的版本,它在 2.0 上运行。这不应该工作吗?我不明白什么?

于 2013-08-15T02:52:20.097 回答
-3

看起来你正在使用 Linux。尝试通过首先安装 ruby​​ 和 rvm 来遵循 rails 安装。这可能是 ruby​​ 版本过时的原因。扔在黑暗中。

于 2013-02-19T04:36:34.283 回答