我正在尝试为Rails项目执行'bundle install'。 但是我被击中了
Installing debugger (1.5.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
c:/jruby-1.7.4/bin/jruby.exe extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=tru
e to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.
(root) at c:/jruby-1.7.4/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1054
(root) at c:/jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:1
(root) at extconf.rb:15
Gem files will remain installed in c:/jruby-1.7.4/lib/ruby/gems/shared/gems/debu
gger-1.5.0 for inspection.
Results logged to c:/jruby-1.7.4/lib/ruby/gems/shared/gems/debugger-1.5.0/ext/ru
by_debug/gem_make.out
An error occurred while installing debugger (1.5.0), and Bundler cannot
continue.
Make sure that `gem install debugger -v '1.5.0'` succeeds before bundling.
然后我试了
$ gem install debugger -v '1.5.0'
WARNING: RubyGems 1.2+ index not found for:
RubyGems will revert to legacy indexes degrading performance.
Updating metadata for 1 gems from http://rubygems.org/
.
complete
ERROR: While executing gem ... (Errno::EACCES)
Access to the path 'c:\Program Files\IronRuby 1.1\Lib\ruby\gems\1.9.1\source
_cache' is denied.
所有宝石都已正确安装,但宝石安装因宝石调试器(1.5.0)而停止
我的宝石环境是:
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-mswin32]
- INSTALLATION DIRECTORY: c:/Program Files/IronRuby 1.1/Lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: "c:/Program Files/IronRuby 1.1/bin/ir.exe"
- EXECUTABLE DIRECTORY: c:/Program Files/IronRuby 1.1/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-dotnet-4.0
- GEM PATHS:
- c:/Program Files/IronRuby 1.1/Lib/ruby/gems/1.9.1
- c:/Users/swapnil/.gem/ironruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
提前致谢。
答案 0 :(得分:0)
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.
这似乎是你的问题,所以只需启用JRuby的C扩展支持,看看是否有效!
答案 1 :(得分:0)
您使用的是JRuby
还是IronRuby
? debugger
不适用于JRuby
(请参阅here),但我从未尝试使用IronRuby
。
答案 2 :(得分:0)
调试器gem仅适用于CRuby(MRI)。如果您使用的是不同的Ruby实现,则需要使用该平台本机的调试器。
Chris Gaffney的This blog post解释了如何基于Ruby平台有条件地包含不同的调试宝石。
答案 3 :(得分:0)
如果您使用的是RVM并且没有正确采购,可能会发生这种情况。
user$ source ~/.rvm/scripts/rvm
并确保以下命令返回“rvm is a function”
user$ type rvm | head -n 1
rvm is a function