0

I am getting the following error and dont know how to solve this. Can someone simplify this process?

My Jruby is installed in

C:/jruby-1.7.13/bin

my project is in

C:/Users/myname/downloads/projectdirectory

The error is when I do

bundle install

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

c:/jruby-1.7.13/bin/jruby.exe extconf.rb
  NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

    (root) at c:/jruby-1.7.13/lib/ruby/shared/mkmf.rb:8
    require at org/jruby/RubyKernel.java:1065
    (root) at c:/jruby-1.7.13/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
    (root) at extconf.rb:2


    Gem files will remain installed in c:/jruby-1.7.13/lib/ruby/gems/shared/gems/pg-0.17.0 for inspection.
    Results logged to c:/jruby-1.7.13/lib/ruby/gems/shared/gems/pg-0.17.0/ext/gem_make.out
     An error occurred while installing pg (0.17.0), and Bundler cannot continue.
     Make sure that `gem install pg -v '0.17.0'` succeeds before bundling.
RedX
  • 14,749
  • 1
  • 53
  • 76
Prerak Diwan
  • 509
  • 4
  • 8
  • Possible duplicate of [How to enable C extension support in jRuby?](http://stackoverflow.com/questions/15795942/how-to-enable-c-extension-support-in-jruby) – koppor Nov 14 '15 at 13:02

1 Answers1

0

C- extensions are not really supported in JRuby and were actually dropped in the 1.7.x line ...

thus despite the message mentioning -Xcext.enabled=true won't help you!

since it's pg you're trying, there's a jruby alternative that uses a Java API instead of C pg_jruby, alternatively if you're using active-record look for activerecord-jdbc-adapter + jdbc-postgres

kares
  • 7,076
  • 1
  • 28
  • 38
  • I installed pg_jruby using "gem install pg_jruby" but still getting the same error. – Prerak Diwan Aug 21 '15 at 17:19
  • In general whenever I try to install a gem that involves a native extension throws the same error. Is there a solution that can enable all extensions installation? – Prerak Diwan Aug 21 '15 at 22:03