C extension support is not enabled. [pry-stack_explorer]


I am Facing the below issue when installing the gem pry-stack_explorer
through jruby. also tried with -Xcext.enabled=true , but same issue.
Please help.

JRUBY Version : jruby-1.7.8


[email protected]:~/build_8x$ jruby -Xcext.enabled=true -S gem install
Building native extensions. This could take a while…
ERROR: Error installing pry-stack_explorer:
ERROR: Failed to build gem native extension.

/home/khirod/jruby-1.7.8/bin/jruby extconf.rb

NotImplementedError: C extension support is not enabled. Pass
-Xcext.enabled=true to JRuby or set JRUBY_OPTS.

(root) at /home/khirod/jruby-1.7.8/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1084
(root) at
(root) at extconf.rb:19

Gem files will remain installed in
for inspection.
Results logged to


Work around:

I have follow the below work around of my own, not sure it should be
recommended. but I can install the gem and it works fine for me.

  1. create a directory structure $JRUBY_HOME/lib/native/include

export JRUBY_OPTS=-Xcext.enabled=true

  1. installed ruby-19 locally , just to take the *.h files.

  2. create a soft link from $JRUBY_HOME/lib/native/include . i.e.

ln -s /home/khirod/ruby_19/include/ruby-1.9.1/ruby ruby

  1. jruby -S gem install pry-nav
  2. jruby -S gem install pry-stack_explorer

Now I can use the debug syntax of pry-stack_explorer.

Please suggests if anybody have any better tricks and idea.