You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Basic Bundler operations don't seem to work on Windows #209
I found this in a more complex gem, but I'm reproducing here to make the problem more clear in simpler code. That gem does bundle exec rake, so it's not a Rake / RSpec thing.
Not sure what the issue is. YARD uses rspec (the only repo I immediately thought of), and it's using Bundler 2 and a rake task.
I looked at the branch you added Windows CI to. You might add quotes around the 3.0 version in the workflow file, as it's interpreted as '3' by the parser. So, when Ruby 3.1 is released, it will jump to that... Also, personal preference, but '-latest` for OS designation may change, which you may not want...
Yes in my other repo it actually finds rake, starts to run it, then during the load of Gems it then complains rake isn't installed! I get backtraces like this
C:/hostedtoolcache/windows/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:374:in `block in replace_bin_path': can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
from C:/hostedtoolcache/windows/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:402:in `block in replace_bin_path'
from D:/a/shopify-cli/shopify-cli/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<main>'
I think the problem is there is no Rakefile
Does Bundler need a Rakefile to run? It doesn't in macOS or Ubuntu.
C:/hostedtoolcache/windows/Ruby/2.7.4/x64/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:462:in `block in replace_bin_path': can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
from C:/hostedtoolcache/windows/Ruby/2.7.4/x64/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:482:in `block in replace_bin_path'
from D:/a/seafoam/seafoam/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<main>'
It does work with 2.2.17, but doesn't work with 2.1.4. I'm not going to bisect that further, but that's the fix - you need to use a more recent Bundler on Windows than you do on other platforms, and it needs to be at least I guess 2.2 or so.
I don't know if that needs to be documented, or tested for, or something like that.
Activity
MSP-Greg commentedon Jul 28, 2021
@chrisseaton
Not sure what the issue is. YARD uses rspec (the only repo I immediately thought of), and it's using Bundler 2 and a rake task.
I looked at the branch you added Windows CI to. You might add quotes around the 3.0 version in the workflow file, as it's interpreted as '3' by the parser. So, when Ruby 3.1 is released, it will jump to that... Also, personal preference, but '-latest` for OS designation may change, which you may not want...
eregon commentedon Jul 29, 2021
https://github.com/Shopify/seafoam/runs/3186334964#step:3:22
Can you try by removing the
BUNDLE WITHsection in https://github.com/Shopify/seafoam/blob/722a029eb268c3e00d8a946c5f554ad0b28e265f/Gemfile.lock#L58-L59, or updating to 2.x withbundle update --bundler?If that's not it, I suspect a potential regression in Bundler.
But should definitely make sure Bundler 2 is used first, Bundler 1 is no longer being developed and might not work with recent Rubies AFAIK.
eregon commentedon Jul 29, 2021
Note that
bundle exec rake --versiondoes work in this repo's CI:https://github.com/ruby/setup-ruby/runs/3171185439#step:17:10
I think the problem is there is no Rakefile in https://github.com/Shopify/seafoam/tree/windows-ci
Also rake has some nasty exception/backtrace swallowing, some of it got recently fixed: ruby/rake#367
chrisseaton commentedon Jul 29, 2021
Yes in my other repo it actually finds
rake, starts to run it, then during the load of Gems it then complainsrakeisn't installed! I get backtraces like thisDoes Bundler need a Rakefile to run? It doesn't in macOS or Ubuntu.
chrisseaton commentedon Jul 29, 2021
I don't think it's using Rake or not. I added a Rakefile, and same issue.
Shopify/seafoam@5667055
https://github.com/Shopify/seafoam/runs/3191396713#step:4:11
chrisseaton commentedon Jul 29, 2021
It is fixed by upgrading to most recent Bundler though, so I'll investigate in that direction.
chrisseaton commentedon Jul 29, 2021
It does work with
2.2.17, but doesn't work with2.1.4. I'm not going to bisect that further, but that's the fix - you need to use a more recent Bundler on Windows than you do on other platforms, and it needs to be at least I guess2.2or so.I don't know if that needs to be documented, or tested for, or something like that.
eregon commentedon Jul 29, 2021
I added
bundle exec rakein this repo CI, and it passes for everything except JRuby on Windows, which is a known bug: e08bf35 #18 (comment)rakecertainly does. The error might just be confusing or the wrong one, but that's just a guess.eregon commentedon Jul 29, 2021
Documented in 77d7ca9.
chrisseaton commentedon Jul 29, 2021
I don't run
rakethough.eregon commentedon Jul 29, 2021
^ indeed, my bad, I was confusing with some other log.