Unable to use bundler with jruby-complete for versions 1.7.21 and 9.0.0.0. 1.7.19 works as expected. #3186

Closed
slawo-ch opened this Issue Jul 25, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@slawo-ch

Installing the bundler gem, then invoking bundle yields a LoadError in jruby-complete 1.7.21 and 9.0.0.0

For the test case, consider the following bash script install-jruby, which fetches a given jruby version, installs the bundler gem and calls bundle init.

#!/bin/bash

JRUBY_VERSION="${1:-1.7.19}"

# bail on errors
set -e

# re-create clean test directory for given version
rm -rf "$JRUBY_VERSION"
mkdir -p "$JRUBY_VERSION"
cd "$JRUBY_VERSION"

echo "* Getting jruby $JRUBY_VERSION"
curl -o "jruby-complete-$JRUBY_VERSION.jar" "https://s3.amazonaws.com/jruby.org/downloads/$JRUBY_VERSION/jruby-complete-$JRUBY_VERSION.jar"

echo "* Creating gem_home"
mkdir gem_home


export PATH="gem_home/bin:$PATH" 
export GEM_HOME="gem_home" 
export GEM_PATH="gem_home" 

echo "* Installing bundler"
java -cp "jruby-complete-$JRUBY_VERSION.jar" org.jruby.Main -S gem install -i gem_home --no-rdoc --no-ri bundler

echo "* Listing installed gems"
java -cp "jruby-complete-$JRUBY_VERSION.jar" org.jruby.Main -S gem list

echo "* Calling bundle init"
java -cp "jruby-complete-$JRUBY_VERSION.jar" org.jruby.Main -S bundle init

echo "* Done"

I'm getting the following outputs when invoking the script for different versions of jruby:

1.7.19

$ ./install-jruby 1.7.19
* Getting jruby 1.7.19
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.4M  100 21.4M    0     0  2552k      0  0:00:08  0:00:08 --:--:-- 3375k
* Creating gem_home
* Installing bundler
Fetching: bundler-1.10.6.gem (100%)
Successfully installed bundler-1.10.6
1 gem installed
* Listing installed gems

*** LOCAL GEMS ***

bundler (1.10.6)
ffi (1.9.3 java)
jar-dependencies (0.1.2)
jruby-openssl (0.9.5 java)
json (1.8.0 java)
krypt (0.0.2)
krypt-core (0.0.2 universal-java)
krypt-provider-jdk (0.0.2)
rake (10.1.0)
rdoc (4.1.2)
* Calling bundle init
Writing new Gemfile to /Users/slawo/Desktop/jruby-complete-testcase/1.7.19/Gemfile
* Done

1.7.21

./install-jruby 1.7.21
* Getting jruby 1.7.21
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22.5M  100 22.5M    0     0  2758k      0  0:00:08  0:00:08 --:--:-- 3325k
* Creating gem_home
* Installing bundler
Fetching: bundler-1.10.6.gem (100%)
Successfully installed bundler-1.10.6
1 gem installed
* Listing installed gems

*** LOCAL GEMS ***

bundler (1.10.6)
jar-dependencies (0.1.15)
jruby-openssl (0.9.7 java)
json (1.8.0 java)
rake (10.1.0)
rdoc (4.1.2)
* Calling bundle init
jruby: No such file or directory -- bundle (LoadError)

9.0.0.0

./install-jruby 9.0.0.0
* Getting jruby 9.0.0.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19.4M  100 19.4M    0     0  2802k      0  0:00:07  0:00:07 --:--:-- 3820k
* Creating gem_home
* Installing bundler
Fetching: bundler-1.10.6.gem (100%)
Successfully installed bundler-1.10.6
1 gem installed
* Listing installed gems

*** LOCAL GEMS ***

bundler (1.10.6)
jar-dependencies (0.1.15)
jruby-openssl (0.9.7 java)
json (1.8.0 java)
minitest (5.4.1)
power_assert (0.2.3)
psych (2.0.14.pre1 java)
rake (10.1.0)
rdoc (4.1.0)
test-unit (3.0.3)
* Calling bundle init
jruby: No such file or directory -- bundle (LoadError)

@mkristian mkristian self-assigned this Jul 25, 2015

@mkristian mkristian added this to the JRuby 1.7.22 milestone Jul 25, 2015

@rtyler

This comment has been minimized.

Show comment
Hide comment
@rtyler

rtyler Aug 1, 2015

Excellent reproduction case, thank you @slawo-ch

rtyler commented Aug 1, 2015

Excellent reproduction case, thank you @slawo-ch

@enebo enebo modified the milestones: JRuby 1.7.22, JRuby 1.7.23 Aug 20, 2015

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Oct 1, 2015

Member

ok the relative path entry in $PATH does not work (added -Djruby.debug.scriptResolution=true to the java command):

* Calling bundle init
Trying path: /Users/cmeier/projects/sandbox/jruby/9.0.1.0
Trying path: uri:classloader://META-INF/jruby.home/bin
Trying path: /Users/cmeier/projects/sandbox/jruby/9.0.1.0/bin
Trying path: uri:classloader:/bin
Trying path: gem_home/bin
Trying path: /usr/local/bin
Trying path: /usr/bin
Trying path: /bin
Trying path: /usr/sbin
Trying path: /sbin
Trying path: /opt/X11/bin
Trying path: /usr/local/MacGPG2/bin
jruby: No such file or directory -- bundle (LoadError)

working on it

Member

mkristian commented Oct 1, 2015

ok the relative path entry in $PATH does not work (added -Djruby.debug.scriptResolution=true to the java command):

* Calling bundle init
Trying path: /Users/cmeier/projects/sandbox/jruby/9.0.1.0
Trying path: uri:classloader://META-INF/jruby.home/bin
Trying path: /Users/cmeier/projects/sandbox/jruby/9.0.1.0/bin
Trying path: uri:classloader:/bin
Trying path: gem_home/bin
Trying path: /usr/local/bin
Trying path: /usr/bin
Trying path: /bin
Trying path: /usr/sbin
Trying path: /sbin
Trying path: /opt/X11/bin
Trying path: /usr/local/MacGPG2/bin
jruby: No such file or directory -- bundle (LoadError)

working on it

@mkristian mkristian closed this in 52082d1 Oct 2, 2015

@paulmenzel

This comment has been minimized.

Show comment
Hide comment
@paulmenzel

paulmenzel Jan 13, 2016

Hi. Do you know if this issue has also been fixed in 1.7.x? I am running into a similar problem and I am just asking before creating a new issue.

Hi. Do you know if this issue has also been fixed in 1.7.x? I am running into a similar problem and I am just asking before creating a new issue.

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Jan 13, 2016

Member

@paulmenzel the label says fixed with 1.7.23 - so if you see the same issue with jruby-1.7.23 then please create a new issue or let me know to reopen this one

Member

mkristian commented Jan 13, 2016

@paulmenzel the label says fixed with 1.7.23 - so if you see the same issue with jruby-1.7.23 then please create a new issue or let me know to reopen this one

@paulmenzel

This comment has been minimized.

Show comment
Hide comment
@paulmenzel

paulmenzel Jan 18, 2016

@mkristian, thanks! I created the new issue #3601.

@mkristian, thanks! I created the new issue #3601.

@StephenOTT StephenOTT referenced this issue in vert-x3/vertx-stack Feb 22, 2018

Open

Stack Manager: ruby gems support? #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment