bundle can not find (jruby) platform gems #2135

Closed
kares opened this Issue Oct 29, 2012 · 6 comments

Comments

Projects
None yet
7 participants

kares commented Oct 29, 2012

Gemfile

source "http://rubygems.org"
gem 'jruby-rack-worker', "0.7"

NOTE: jruby-rack-worker 0.7 is gemspec-ed with gem.platform = 'java'

bundle ends up with :

Fetching gem metadata from http://rubygems.org/...
Could not find jruby-rack-worker-0.7-java in any of the sources

gem install jruby-rack-worker -v 0.7 works as a work-around :

Fetching: jruby-rack-worker-0.7-jruby.gem (100%)
Successfully installed jruby-rack-worker-0.7-java
1 gem installed

bundle than work as expected :

Using jruby-rack (1.1.10) 
Using jruby-rack-worker (0.7) 
Using bundler (1.2.1) 

Bundler version 1.2.1
JRuby jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) same on 1.7.0

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.8.7 (2012-09-18 patchlevel 357) [java]
  - INSTALLATION DIRECTORY: /opt/local/rvm/gems/jruby-1.6.8@trinidad
  - RUBY EXECUTABLE: /opt/local/rvm/rubies/jruby-1.6.8/bin/jruby
  - EXECUTABLE DIRECTORY: /opt/local/rvm/gems/jruby-1.6.8@trinidad/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-java-1.6
  - GEM PATHS:
     - /opt/local/rvm/gems/jruby-1.6.8@trinidad
     - /opt/local/rvm/gems/jruby-1.6.8@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-rdoc --no-ri"
     - "update" => "--no-rdoc --no-ri"
     - "gem" => "--no-ri --no-rdoc"
     - :sources => ["http://gems.rubyforge.org"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

kares referenced this issue in kares/jruby-rack-worker Oct 29, 2012

Open

[hack] remove gem.platform = 'jruby' #7

Owner

indirect commented Oct 29, 2012

This sounds like a bug in the way that Bundler handles gems that only exist on one platform. Thanks for reporting!

joelash commented Dec 12, 2012

+1

👍

t6d commented Jun 11, 2013

+1

Contributor

xaviershay commented Aug 13, 2013

Looks like it's fixed on 1.3.5. The following works for me:

#!/bin/bash

set -ex

ISSUE=2135

mkdir -p /tmp/repro-$ISSUE
cd /tmp/repro-$ISSUE

# Must use jruby
(ruby -v | grep jruby) || exit 1

# Need to not have this gem installed
(! gem list jruby-rack-worker | grep jruby-rack) || exit 1

cat > Gemfile <<EOF
source "https://rubygems.org"
gem 'jruby-rack-worker', "0.7"
EOF

bundle install

(protip to run this with rbenv: rbenv shell jruby-1.7.4 before executing)

xaviershay closed this Aug 13, 2013

@kares kares referenced this issue in jruby/jruby Jun 18, 2014

@mkristian mkristian remove wrong import 6a4cca9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment