Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

"gem install bundler" fails using 2.0 or 2.1 mode #1595

Closed
donv opened this Issue · 17 comments
@donv
Collaborator

Hi!

gem install bundler fails:

$ rvm use jruby
Using /Users/uwe/.rvm/gems/jruby-1.7.11
$ ruby --version
jruby 1.7.11 (1.9.3p392) 2014-02-24 86339bb on Java HotSpot(TM) 64-Bit Server VM 1.7.0_51-b13 [darwin-x86_64]
$ gem install bundler
Successfully installed bundler-1.6.0
1 gem installed
$ ruby --1.9 -S gem install bundler
Successfully installed bundler-1.6.0
1 gem installed
$ ruby --2.0 -S gem install bundler
ERROR:  While executing gem ... (ArgumentError)
    marshal data too short
$ rvm use jruby-head
Using /Users/uwe/.rvm/gems/jruby-head
$ ruby --version
jruby 9000.dev (2.1.2) 2014-03-29 6035ded on Java HotSpot(TM) 64-Bit Server VM 1.7.0_51-b13 [darwin-x86_64]
$ gem install bundler
ERROR:  While executing gem ... (ArgumentError)
    marshal data too short

Other rubies work OK, including JRuby in 1.9.3 mode:

$ rvm use 2.1.1
Using /Users/uwe/.rvm/gems/ruby-2.1.1
$ ruby --version
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
$ gem install bundler
Fetching: bundler-1.6.0.gem (100%)
Successfully installed bundler-1.6.0
1 gem installed
$ rvm use 2.0.0
Using /Users/uwe/.rvm/gems/ruby-2.0.0-p451
$ ruby --version
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-darwin12.5.0]
$ gem install bundler
Fetching: bundler-1.6.0.gem (100%)
Successfully installed bundler-1.6.0
1 gem installed
$ rvm use 1.9.3
Using /Users/uwe/.rvm/gems/ruby-1.9.3-p545
$ ruby --version
ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-darwin13.1.0]
$ gem install bundler
Fetching: bundler-1.6.0.gem (100%)
Successfully installed bundler-1.6.0
1 gem installed
@LTe

The same here

╰─$ ruby -v                                                                                                                                                                                                     
jruby 9000.dev (2.1.2) 2014-03-31 d68cc0e on Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18 [linux-amd64]
╰─$ gem install bundler                                                                                                                                                                                              
ERROR:  While executing gem ... (ArgumentError)
    marshal data too short
@masover

I can't reproduce this:

$ rbenv shell jruby-1.7.11 
$ ruby --version
jruby 1.7.11 (2.0.0p195) 2014-02-24 86339bb on OpenJDK 64-Bit Server VM 1.7.0_51-b00 [linux-amd64]
$ ruby --2.0 -S gem install bundler
Fetching: bundler-1.6.0.gem (100%)
Successfully installed bundler-1.6.0
1 gem installed

The only difference that jumps out at me is the Java version, and that I have a .jrubyrc that specifies 2.0 mode (but I can't reproduce it if I remove that), and that I'm running rbenv instead of rvm.

@enebo
Owner

I can confirm that there seems to be an issue unmarshalling something on master when installing a gem.

@enebo
Owner

Narrowed down a little bit. This is not a marshalling issue. It fails:

str = Gem::RemoteFetcher.fetcher.fetch_path uri

str is "" at this point (in api_set.rb). The other difference between master and jruby-1_7 is master is using 2.2.2 while 1.7 branch is at 2.1.9.

@LTe
LTe commented

@enebo good job! It turned out that Net::HTTPOK object does not have filled body instance variable. So this issue is strongly related to #1216

@LTe
LTe commented

After applying this patch everything works. Thanks @djmaze!

╰─$ bin/ruby bin/jgem install bundler                                                                                                                                                                            Successfully installed bundler-1.6.1
1 gem installed
@enebo
Owner

@LTe Awesome...I did figure out that gzip was the culprit by the end of yesterday...I did not notice this other issue. I will try and commit something this morning on this...but I will try and figure out why the block form is not working in the first place...

@enebo enebo closed this in 2cbe7e5
@enebo
Owner

I fixed this on 1.7 branch with the workaround @djmaze came up with. The amount of API changing needed to fix this for 2.0 mode (which is always going to be experimental on 1.7.x) made me nervous :)

Fixed in commit 89ef3e9

@enebo enebo added this to the JRuby 1.7.12 milestone
@plukevdh

thank you!

@ncuesta

I know it's been a long time since this issue was closed, but I'm getting the same marshall data too short on a fresh install of jruby-1.7.18. I'm not getting such error when running the same gem install command with jruby in 1.9 mode.

$ ruby --1.9 -v
jruby 1.7.18 (1.9.3p551) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.7.0_55-b13 [darwin-x86_64]
$ ruby --1.9 -S gem install bundler
Successfully installed bundler-1.7.12
1 gem installed

$ ruby --2.0 -v
jruby 1.7.18 (2.0.0p598) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.7.0_55-b13 [darwin-x86_64]
$ ruby --2.0 -S gem install bundler
ERROR:  While executing gem ... (ArgumentError)
    marshal data too short

BTW I'm using rbenv 0.4.0, if that affects anything.

Thanks in advance

@just3ws

Hi, I'm getting this as well.

  • RVM 1.26.9
  • Bundler 1.7.9
  • RubyGems 2.4.5
  • OS X 10.10.1 (14B25)
  • jruby 1.7.18 (2.0.0p598) 2014-12-22 625381c on Java HotSpot(TM) 64-Bit Server VM 1.7.0_51-b13 +jit [darwin-x86_64]
  • ~/.jrubyrc

    cext.enabled=true
    compat.version=2.0
    
  • java -version

    java version "1.7.0_51"
    Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

When I gem update...

    $ gem update --verbose                                                                                                                                                                          
    Updating installed gems
    GET https://api.rubygems.org/specs.4.8.gz
    302 Moved Temporarily
    GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
    304 Not Modified
    Updating bundler
    HEAD https://api.rubygems.org/api/v1/dependencies
    200 OK
    GET https://api.rubygems.org/api/v1/dependencies?gems=bundler
    200 OK
    ERROR:  While executing gem ... (ArgumentError)
        marshal data too short

Update

  • Removed compat.version=2.0
  • gem update
  • bundle --version => 1.7.12
  • Restore compat.version=2.0
  • gem update => :+1:
@n0nick

I have the same issue.

jruby 1.7.19 2015-01-29 20786bd on OpenJDK 64-Bit Server VM.

Doing $ jruby --1.9 -S gem install bundler mitigated this for now. I was able to continue with bundle install and install other gems.

@kikorb

I have the same issue here using jruby-1.7.9 and ruby-version 2.0
I know the support for 2.0 is experimental but it will be nice to have the patch everywhere so we don't have to do --1.9 -S everytime we find this issue

@g3d
> ruby -v                                                                                                
jruby 1.7.20 (2.0.0p598) 2015-05-04 3086e6a on Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13 +jit [darwin-x86_64]

> сat .jrubyrc
compat.version=2.0

> gem install bundler
ERROR:  While executing gem ... (ArgumentError)
    marshal data too short
@splattael

I've ran into a similar issue.

Applying the patch 89ef3e9 to .rvm/rubies/jruby-1.7.20/lib/ruby/2.0/net/http/response.rb fixed it for me.

It's strange that 89ef3e9 did not make it into 1.7.20 although it's from April 2014 (1.7.12).

@mjc

This definitely still exists and 89ef3e9 didn't get applied.

@voondo

Same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.