Bundler JRuby/MRI Ruby problems (ruby-debug)

195 views
Skip to first unread message

sahglie

unread,
Sep 30, 2010, 1:49:43 PM9/30/10
to ruby-bundler
I'm getting some strange behaviour with bundler and I'm not sure if
it is due to a bug or perhaps a misunderstanding on my part about how
to correctly use bundler. I have a project that I work on in jruby
as well as mri ruby. One of the gems I'm using is ruby-debug.
This gem actually has different dependencies when run under jruby vs
mri ruby (which may be the problem):

## Under JRuby

$ gem dependency ruby-debug
Gem ruby-debug-0.10.3
columnize (>= 0.1, runtime)
ruby-debug-base (~> 0.10.3.0, runtime)

Gem ruby-debug-base-0.10.3.2-java

## Under MRI Ruby

$ gem dependency ruby-debug
Gem ruby-debug-0.10.3
columnize (>= 0.1, runtime)
ruby-debug-base (~> 0.10.3.0, runtime)

Gem ruby-debug-base-0.10.3
linecache (>= 0.3, runtime)


So to make this as simple as possible, let's say I setup my project's
Gemfile like so under mri ruby:

## Gemfile

source :rubygems
gem "ruby-debug"


## Now Install

$ bundle install

## Gemfile.lock

WARNING: JRuby does not support native extensions or the `mkmf'
library.
GEM
remote: http://rubygems.org/
specs:
columnize (0.3.1)
linecache (0.43)
ruby-debug (0.10.3)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.3.0)
ruby-debug-base (0.10.3)
linecache (>= 0.3)

PLATFORMS
ruby

DEPENDENCIES
ruby-debug



Great, everything works. Until I switch over to JRuby.

$ rvm use jruby-1.5.3
$ bundle check
The following gems are missing
* linecache (0.43)
* ruby-debug-base (0.10.3)
Install missing gems with `bundle install`

Ok I guess I'll install

$ bundle install
Fetching source index for http://rubygems.org/
Using columnize (0.3.1)
Installing linecache (0.43) with native extensions /Users/glie/.rvm/
rubies/jruby-1.5.3/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in
`build_extensions': ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)

Ok that didn't work, maybe update?

$ bundle update
Fetching source index for http://rubygems.org/
Using columnize (0.3.1)
Installing linecache (0.43) with native extensions /Users/glie/.rvm/
rubies/jruby-1.5.3/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in
`build_extensions': ERROR: Failed to build gem native extension.
(Gem::Installer::ExtensionBuildError)


Same thing. So it appears that no matter what I do I'm stuck... I
can always delete my Gemfile.lock and then do an install with jruby
but that's not really workable in the long run.

If anyone has any ideas about what I can do to work around this
problem
I'd really appreciate it.

Thanks,
Steven

slyphon

unread,
Nov 10, 2010, 12:06:32 AM11/10/10
to sahglie, ruby-b...@googlegroups.com

>   Fetching source index forhttp://rubygems.org/


>   Using columnize (0.3.1)
>   Installing linecache (0.43) with native extensions /Users/glie/.rvm/
> rubies/jruby-1.5.3/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in
> `build_extensions': ERROR: Failed to build gem native extension.
> (Gem::Installer::ExtensionBuildError)
>
> Ok that didn't work, maybe update?
>
>   $ bundle update

>   Fetching source index forhttp://rubygems.org/


>   Using columnize (0.3.1)
>   Installing linecache (0.43) with native extensions /Users/glie/.rvm/
> rubies/jruby-1.5.3/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in
> `build_extensions': ERROR: Failed to build gem native extension.
> (Gem::Installer::ExtensionBuildError)
>
> Same thing.  So it appears that no matter what I do I'm stuck... I
> can always delete my Gemfile.lock and then do an install with jruby
> but that's not really workable in the long run.
>
> If anyone has any ideas about what I can do to work around this
> problem
> I'd really appreciate it.
>
> Thanks,
> Steven

Did you ever resolve this issue? I'm running into the exact same
problem using rvm + jruby.

Steven Hansen

unread,
Nov 11, 2010, 9:58:41 PM11/11/10
to slyphon, ruby-b...@googlegroups.com
I have not resolved the issue.  I did open a ticket in the bundler github project 
which is currently flagged as "investigate," but that's it.  I would recommend
voting on the issue in github so hopefully it will get more attention.

Jonathan Simms

unread,
Nov 19, 2010, 8:55:29 PM11/19/10
to Steven Hansen, ruby-b...@googlegroups.com
As a short term workaround, I've found specifying the exact versions
of ruby-debug and ruby-debug-base that comes with rvm's jruby seems to
not barf.

In my case, w/ jruby-1.5.3

group :development, :test do
gem 'ruby-debug-base', '= 0.10.3.2'
gem 'ruby-debug', '= 0.10.3'
end

bundle install will then run without issue (for me)

sahglie

unread,
Dec 17, 2010, 4:55:59 PM12/17/10
to ruby-bundler

Unfortunately, that didn't work for me. I still get the error. The
problem, is that
the jruby version of ruby-debug-base is not available as a remote
gem. Try doing
gem install ruby-debug-base while using jruby and you'll get an error.

I did manage to find a temporary work around:

1) Download the jruby-debug-base gem and extract it.
2) Put the gem in a github project and make sure you include .gemspec
in it's root directory.
3) Update your bundler Gemspec with something like:

platforms :jruby do
gem "ruby-debug-base", "0.10.3.4", :git => "http://github.com/
sahglie/ruby-debug-base.git"
end
Reply all
Reply to author
Forward
0 new messages