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

Not working on bundler for Windows #31

Closed
loopyd opened this issue Aug 16, 2022 · 1 comment · Fixed by #32
Closed

Not working on bundler for Windows #31

loopyd opened this issue Aug 16, 2022 · 1 comment · Fixed by #32
Assignees
Labels
bug Something isn't working
Milestone

Comments

@loopyd
Copy link
Contributor

loopyd commented Aug 16, 2022

Issue Report

Submitted: 08/16/2022 1:40 PM PDT

Problem

Cake module does not work on Ruby / bundler mingw installations for jekyll local tests.

What happens?

Given dough:

#addin nuget:?package=Cake.Jekyll&version=2.0.0

var target = Argument("target", "BuildJekyll");
var configuration = Argument("configuration", "Debug");

Task("CleanJekyll")
    .Does(() =>
{
    JekyllClean(settings => settings
        .SetLogLevel(JekyllLogLevel.Verbose)
        .SetWorkingDirectory("./docs"));
});

Task("BuildJekyll")
    .IsDependentOn("CleanJekyll")
    .Does(() =>
{
    JekyllBuild(settings => settings
        .SetLogLevel(JekyllLogLevel.Verbose)
        .SetWorkingDirectory("./docs"));
});

RunTarget(target);

Result is:

========================================
CleanJekyll
========================================
An error occurred when executing task 'CleanJekyll'.
Error: An error occurred trying to start process '"C:/tools/Ruby31-x64/Ruby31-x64/bin/bundle"' with working directory 'D:/source/repos/work/ecs-saber/docs'. The specified executable is not a valid application for this OS platform.

System Configuration

Please note that jekyll builds fine with bundler outside of the cake tool on this system.

Host OS

OS Name	Microsoft Windows 11 Home
Version	10.0.22000 Build 22000

Ruby Version

PS D:\source\repos\work\ecs-saber> ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]

Bundler Version

PS D:\source\repos\work\ecs-saber> bundler -v
Bundler version 2.3.20

Jekyll Version

PS D:\source\repos\work\ecs-saber> jekyll -v
jekyll 4.2.2

Expected Result

Building jekyll works with bundler outside of the cake tool works, indicating that the cake tool should. It does not as the build fails with an error about the operating system set up being unconventional.

Suggested Fix

Add configuration settings to check for .bat or .cmd files, so that the build will succeed when the user has a working configuration. The error is due to a .bat command launcher for mingw being used when on ruby >= 3.0.0 instead of a .cmd command launcher, that the cake tool does not recognize or is able to check for. The fix will account for both scenerios.

@augustoproiete
Copy link
Member

🎉 The changes implemented in response to this issue shipped with Cake.Jekyll v2.1.0

The release is available on:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants