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

JRuby on Windows: "bundler: command not found: rake" #18

Closed
dentarg opened this issue Feb 8, 2020 · 17 comments
Closed

JRuby on Windows: "bundler: command not found: rake" #18

dentarg opened this issue Feb 8, 2020 · 17 comments

Comments

@dentarg
Copy link

dentarg commented Feb 8, 2020

Actions config used:

jobs:
  build:
    name: '${{ matrix.os }}: ${{ matrix.ruby }}'
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-latest, windows-latest ]
        ruby: [ 2.4, 2.5, 2.6, 2.7, jruby, truffleruby ]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby ${{ matrix.ruby }}
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
    - run: ruby -v
    - run: bundle install --jobs 4 --retry 3
    - run: bundle exec rake

Output from the bundle exec rake step

Run bundle exec rake
  bundle exec rake
  shell: C:\Program Files\PowerShell\6\pwsh.EXE -command ". '{0}'"
bundler: command not found: rake
Install missing gem executables with `bundle install`
##[error]Process completed with exit code 1.

The bundle install step before do install rake

I assume JRuby on Windows should work out-of-the-box, right? Am I doing something wrong?

I saw #12, so I checked the asciidoctor-epub3 repo, they are installing bundler themselves, maybe that makes a difference somewhere


Status: see #18 (comment) and below

dentarg added a commit to dentarg/dyno_metadata that referenced this issue Feb 8, 2020
@eregon
Copy link
Member

eregon commented Feb 8, 2020

I'm unsure what's going on.
Could you try if first installing latest bundler (gem install bundler) helps? Shouldn't be necessary, but at least would rule out a Bundler bug already fixed.

@eregon
Copy link
Member

eregon commented Feb 8, 2020

I assume JRuby on Windows should work out-of-the-box, right?

That's the aim but my impression is very few people run JRuby in Windows CI in general.
I know little about Windows, even less so about JRuby on Windows.

For instance, I had to figure out myself which launchers to keep and how to get a ruby alias for jruby (jruby/jruby#6042).

@eregon
Copy link
Member

eregon commented Feb 8, 2020

One issue I noticed is ruby -v picks up the system ruby when run with shell: bash:
https://github.com/eregon/setup-ruby-test/runs/433744376
That's not good.

@eregon
Copy link
Member

eregon commented Feb 8, 2020

Various issues here, once again with how to provide a ruby alias for jruby that works in both PowerShell and Bash:

@eregon
Copy link
Member

eregon commented Feb 8, 2020

@eregon
Copy link
Member

eregon commented Feb 8, 2020

Here is a final run:
https://github.com/eregon/setup-ruby-test/runs/433804429?check_suite_focus=true

Still bundler: command not found: rake.
This must be a JRuby bug, since it works fine on MRI, and installing rake via bundle install generate very similar rake.bat and rake files for both MRI and JRuby.
Could you report it to https://github.com/jruby/jruby/issues ?

I'll fix the PATH issue, but long story short it doesn't seem the cause here.

@eregon
Copy link
Member

eregon commented Feb 8, 2020

OK, this is fun bundle exec rake --version and bundle exec rake default work, but bundle exec rake doesn't!
https://github.com/eregon/setup-ruby-test/runs/433859430

Run bundle exec rake --version
rake, version 13.0.1
Run bundle exec rake default
OK
Run bundle exec rake
bundler: command not found: rake
Install missing gem executables with `bundle install`
##[error]Process completed with exit code 1.

@eregon
Copy link
Member

eregon commented Feb 8, 2020

I released 1.41.1 which fixes the PATH so there is no default MRI in PATH, just JRuby.
Now ruby --version and bundle exec rake --version works in both PwSh and Bash.

The rest (bundle exec rake broken) is I believe a JRuby bug, please report it there, I don't think I can do anything about it.

@eregon eregon closed this as completed Feb 8, 2020
@dentarg
Copy link
Author

dentarg commented Feb 8, 2020

@eregon thanks for debugging the issue, I saw your comment at jruby/jruby-launcher#29 (comment), is that something else so I should file another jruby issue about this?

@eregon
Copy link
Member

eregon commented Feb 8, 2020

@dentarg That's something else.

I think the issue is JRuby seems to fail to find executables without arguments on Windows ( bundle exec rake default works, but bundle exec rake doesn't).

dentarg added a commit to dentarg/dyno_metadata that referenced this issue Feb 8, 2020
@slonopotamus
Copy link

I reported this bug to Bundler some time ago: rubygems/bundler#7602. It can be reproduced on any Windows machine with JRuby, it isn't specific to GitHub Actions.

@eregon
Copy link
Member

eregon commented Feb 9, 2020

@slonopotamus Thanks!
I would guess a JRuby issue since it works fine on MRI, and I would think the code for bundle exec doesn't really rely on the interpreter name. But one never knows.

@eregon
Copy link
Member

eregon commented Feb 9, 2020

I reported the bug to JRuby as well, since I think it might be a JRuby bug: jruby/jruby#6053

paulgoetze added a commit to paulgoetze/weka-jruby that referenced this issue Mar 20, 2020
@slonopotamus
Copy link

This was fixed on Bundler side: rubygems/rubygems#3256 (comment)

@eregon
Copy link
Member

eregon commented Jun 20, 2021

Seems to be an issue again: jruby/jruby#6053 (comment)

@dentarg
Copy link
Author

dentarg commented Jul 5, 2021

Seems to be an issue again: jruby/jruby#6053 (comment)
This was fixed on Bundler side: rubygems/rubygems#3256 (comment)

Just an update for anyone finding this thread via search or something, it was concluded that the issue is still with Bundler, rubygems/rubygems#3256 is still open at the time of writing this.

@eregon
Copy link
Member

eregon commented Jul 29, 2021

Another update, it is a bug in JRuby, fixed on master but not yet released: jruby/jruby#6745

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

No branches or pull requests

3 participants