我正在努力让rails工作,并且在运行binding_of_caller
之后无法通过试图与其他gem安装的sudo gem install rails
gem。我不认为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。我也在运行ruby 1.9.3-p385
答案 0 :(得分:11)
尝试更新gem:
$ bundle update binding_of_caller
答案 1 :(得分:3)
在安装Rails之前,使用以下内容添加gem(另请注意gem名称是单数):
$ gem install binding_of_caller
然后运行:
$ bundle update rails
或者:
$ gem install rails
(或者无论rbenv提供什么)
答案 2 :(得分:1)
好的,问题是RBENV ruby版本没有被识别为项目使用的ruby版本。所以在尝试让rbenv工作了一段时间后,我切换回RVM进行了一些调试,并安装了一些依赖项,我安装了ruby 2.0.0p0,并将其识别为项目ruby。然后我就能捆绑了。所以回答我的问题......这是一个红宝石版本的问题。
答案 3 :(得分: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。这不应该工作吗?我不理解的是什么?
答案 4 :(得分:-3)
看起来你正在使用Linux。首先安装ruby和rvm,尝试执行rails安装。这可能是过时的红宝石版本的原因。然而,在黑暗中投掷。