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

121 views
Skip to first unread message

Jedrin

unread,
Apr 2, 2012, 2:42:38 PM4/2/12
to Ruby on Rails: Talk

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 ?

Hassan Schroeder

unread,
Apr 2, 2012, 3:10:05 PM4/2/12
to rubyonra...@googlegroups.com

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` :-)

HTH,
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Jedrin

unread,
Apr 2, 2012, 6:53:20 PM4/2/12
to Ruby on Rails: Talk
>
> 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.



Hassan Schroeder

unread,
Apr 2, 2012, 7:06:10 PM4/2/12
to rubyonra...@googlegroups.com
On Mon, Apr 2, 2012 at 3:53 PM, Jedrin <jrub...@gmail.com> wrote:

>  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 :-)

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

YogiZoli

unread,
Apr 3, 2012, 12:09:04 PM4/3/12
to Ruby on Rails: Talk
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

On Apr 3, 1:06 am, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> On Mon, Apr 2, 2012 at 3:53 PM, Jedrin <jrubia...@gmail.com> wrote:
> >  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  :-)
>
> However you create it, the Gemfile.lock generated via MRI will identify
> the dependency.
>
> --
> Hassan Schroeder ------------------------ hassan.schroe...@gmail.comhttp://about.me/hassanschroeder
> twitter: @hassan

Luis Lavena

unread,
Apr 4, 2012, 7:11:08 PM4/4/12
to rubyonra...@googlegroups.com
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.

--
Luis Lavena

Reply all
Reply to author
Forward
0 new messages