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

Forcing jruby-complete to execute a command. #1218

Closed
blerins opened this Issue Nov 12, 2013 · 3 comments

Comments

Projects
None yet
5 participants
@blerins

blerins commented Nov 12, 2013

Hello!

I'm having some troubles with jruby-complete in environements with rbenv.

$ echo $PATH
/home/blerins/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ java -Djruby.debug.scriptResolution=true -jar target/lib/jruby-complete.jar -S gem install bundler
Found: /home/blerins/.rbenv/shims/gem
SyntaxError: /home/blerins/.rbenv/shims/gem:3: syntax error, unexpected tSTRING_BEG

[ -n "$RBENV_DEBUG" ] && set -x
     ^
$ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ java -Djruby.debug.scriptResolution=true -jar target/lib/jruby-complete.jar -S gem install bundler
Successfully installed bundler-1.3.5
1 gem installed

As seen at:

// run as a command if we couldn't find a script

JRuby always tries to find the script first, I was wondering if there is any possibility to force Jruby to ejecute a command.

related: rbenv/rbenv#467

Thanks!

@BanzaiMan

This comment has been minimized.

Show comment
Hide comment
@BanzaiMan

BanzaiMan Nov 28, 2013

Member

I think there is a bug where the files inside the JAR is not found correctly. Before searching in $PATH, we should be looking inside the JAR, and find META-INF/jruby.home/bin/gem, but aren't.

Quite possibly a different manifestation of #1031.

Member

BanzaiMan commented Nov 28, 2013

I think there is a bug where the files inside the JAR is not found correctly. Before searching in $PATH, we should be looking inside the JAR, and find META-INF/jruby.home/bin/gem, but aren't.

Quite possibly a different manifestation of #1031.

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Nov 28, 2013

Member

well, I do see that error quite regularly :(

but my setup is probably a bit unusual: I manage my MRI with rbenv but added jruby to PATH. that allows me to switch fast to jruby by adding 'j' and to call
jruby -S gem
jruby -S irb
etc

gem,irb, etc are usually a ruby scripts and things just work fine. with having $HOME/.rbenv/shims in the path those scripts are bash scripts :(

but looking through my
~/.rbenv/shims/
directory reveals a lot of scripts which very much look like they come from installed gems:
ast erb jbundle jruby rails rspec turn
autospec gem jgem jrubyc rake ruby
convert_to_should_syntax htmldiff jirb ldiff rdoc testrb
copyright-header irb jirb_swing nbundle ri thin

they all will fail like
java -jar jruby-complete.jar -S thin
because there will never be a thin bin stub within jruby-complete !

I agreee with @BanzaiMan that jruby should look first in the jar before looking on the PATH but it is only a partial solution for the above given problem.

Member

mkristian commented Nov 28, 2013

well, I do see that error quite regularly :(

but my setup is probably a bit unusual: I manage my MRI with rbenv but added jruby to PATH. that allows me to switch fast to jruby by adding 'j' and to call
jruby -S gem
jruby -S irb
etc

gem,irb, etc are usually a ruby scripts and things just work fine. with having $HOME/.rbenv/shims in the path those scripts are bash scripts :(

but looking through my
~/.rbenv/shims/
directory reveals a lot of scripts which very much look like they come from installed gems:
ast erb jbundle jruby rails rspec turn
autospec gem jgem jrubyc rake ruby
convert_to_should_syntax htmldiff jirb ldiff rdoc testrb
copyright-header irb jirb_swing nbundle ri thin

they all will fail like
java -jar jruby-complete.jar -S thin
because there will never be a thin bin stub within jruby-complete !

I agreee with @BanzaiMan that jruby should look first in the jar before looking on the PATH but it is only a partial solution for the above given problem.

@mkristian

This comment has been minimized.

Show comment
Hide comment
@mkristian

mkristian Jun 16, 2015

Member

fixed via fcec818

Member

mkristian commented Jun 16, 2015

fixed via fcec818

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