Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

@slawo-ch
Copy link

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)
@rtyler
Copy link

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
Copy link
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

@paulmenzel
Copy link

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
Copy link
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

@paulmenzel
Copy link

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

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

No branches or pull requests

5 participants