1

我正在尝试为 Rails 项目执行“捆绑安装”。但我被打动了

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.

所有 gem 均已正确安装,但 gem 调试器 (1.5.0) 的 gem 安装停止

我的宝石环境是:

$ 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/

提前致谢。

4

4 回答 4

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 扩展支持,看看它是否有效!

于 2013-08-08T11:29:16.463 回答
0

你是用JRuby还是IronRubydebugger不适用于JRuby(请参阅此处),但我从未尝试过使用IronRuby.

于 2013-08-08T12:25:53.653 回答
0

调试器 gem 仅用于 CRuby (MRI)。如果您使用不同的 Ruby 实现,则需要使用该平台的原生调试器。

Chris Gaffney 的这篇博客文章解释了如何有条件地包含基于 Ruby 平台的不同调试 gem。

于 2013-08-09T07:11:13.437 回答
0

如果您使用的是 RVM 并且来源不正确,则可能会发生这种情况。

user$ source ~/.rvm/scripts/rvm

并确保以下命令返回“rvm is a function”

user$ type rvm | head -n 1
rvm is a function
于 2013-12-19T08:01:07.533 回答