Problem: jruby -S bundle install - tries to build native extension of yajl-ruby

I am trying to build a rails app I wrote in JRuby.
When I run bundle install it errors out on
  yajl-ruby trying to build it as a native extension. I think it must
have some dependency
with a different gem. How can I figure out what is causing it to want
to use that gem or how to
work around it ?

Off the top of my head:

Assuming you're using rvm, create a separate gemset and do your
`bundle install` with MRI and then examine the Gemfile.lock that's
been built.

And for a graphical good time, use `bundle viz` :slight_smile:

HTH,

Assuming you're using rvm, create a separate gemset and do your
`bundle install` with MRI and then examine the Gemfile.lock that's
been built.

Thanks, but I am on windows. I found a FAQ that says RVM doesn't run
on windows.

I believe there's an equivalent for Windows, or you could use a VM to
isolate the experiment from your "regular" installation, but that's really
just about housekeeping, cleanup afterwards, and beside the point :slight_smile:

However you create it, the Gemfile.lock generated via MRI will identify
the dependency.

On win you may wanna use Pik as an alternative of RVM, or you can use
RVM with cgywin, or alternatively using Virtual Machine. I highly
recommend using RVM somehow because you're gonna have Gem version
problems all the time which is really annoying.

This article makes things clear:
http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/

good luck,
@YogiZoli

For JRuby to be able to compile the extension you need a compiler.

Get a compiler that can compile C extensions for JRuby (hint: RubyInstaller’s DevKit is known to be compatible).

Once you install it try to install the gem again.