-
Notifications
You must be signed in to change notification settings - Fork 34
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
Error on Windows installation pact-mock-service.rb:1:in `require': cannot load such file -- pact/mock_service/cli (LoadError) #76
Comments
I'm a bit confused by this one. @uglyog can reproduce the issue on his machine.
I am not a windows user, but my husband is in the office today so I fumbled around with his windows machine and managed to run it without any issues at all. (I took a photo of the screen because it was quicker than working out how to do a screenshot and then working out how to transfer the image to my machine 😆 ) |
Given that the code is the same, it seems like it must be some kind of environmental issue, the most likely cause being an environment variable that's affecting the load path somehow. Could you edit the .bat file and get it to print out your environment variables? |
Just tested against GitHub's two windows runners and all good 🤷🏾♂️ - Will fire up my windows 10 desktop and try shortly windows-2019 - https://github.com/YOU54F/pact-standalone-windows-test/runs/6624009271?check_suite_focus=true#step:3:2731
|
You can also run these commands via our Docker CLI tool, which may get you over the hump for now |
@YOU54F docker CLI does work for me at the moment, but it's not ideal, thank you for addressing this issue. Fingers crossed you would be able to find a root cause |
Hey @ShvetsovZE Just setting up various machines at home to test this out cross platform. In the meantime could you help by providing any additional detail that may be useful. Which shell are you using? the default CMD shell? Have you used this machine for other development, which tools do you have setup? Do you have WSL/WSL2, or git bash available? Has this ever worked for you, or is it this particular version? I need to compile a list of the various shells for windows and a bit of an installation guide, so this might help as a starter for 10! I'll build up a testing matrix, and get it to build against all versions/platforms. I've started the beginnings against on our example repos https://github.com/pactflow/example-bi-directional-consumer-cypress/blob/os_detection/.github/workflows/cross_test.yml Many thanks |
You can also run it directly as a ruby gem, if that helps as an alternative to the Docker CLI https://github.com/pact-foundation/pact-mock_service#with-ruby |
Could you edit the .bat file and get it to print out your environment variables? |
Tested this on the wife's laptop this evening, using a vanilla cmd prompt. zero dev things on the machine and all good, the only thing missing, it is extracted the folder via windows explorer gui as there is no unzip in the cmd prompt this is on a home edition, I have a pro edition, but no enterprise.
|
@YOU54F I have the whole bunch of dev stuff installed including git bash, .net full set up, nvm, and nmp, docker etc. Should I try to run it in the different cmd shell? |
@bethesque as you asked i've adjusted a bet file to show environment variables. I hope that's going to be helpful |
formatted vals for analysis:
|
Ok, looking at https://github.com/pact-foundation/pact-ruby-standalone/blob/master/packaging/pact-mock-service.bat there's nothing obvious in those env vars that is clashing with any that are defined in the .bat file. Next steps. Can you open up the pact-mock-service.bat file on your machine and remove the line that says Also, can you open
That will tell us the paths that the file is meant to be loaded from. Then, can you verify that the file it can't find is actually available at one of those load paths. We do occasionally have issues with requires not working for very long paths in windows, but this is not a long path. Please share the output from each of those changes here. |
@bethesque Output command line without
|
@bethesque Command-line response without
|
Any ideas on what could cause a problem @bethesque? |
Yes, it's a missing windows platform in the PLATFORMS section of the Gemfile.lock. I've fixed it in the latest version of the pact-ruby-standalone. Can you grab the latest copy from the releases page and test it? |
Sorry for the late reply @bethesque, looks like it's working now! |
Pre issue-raising checklist
I have already (please mark the applicable with an
x
):Software versions
Expected behavior
Pact standalone executables are being installed via CMD after following the Windows installation guide and in particular, running
.\bin\pact-mock-service.bat --help start
Actual behaviour
pact-mock-service.bat throws a following error from ruby file
'C:\tools\pact>.\bin\pact-mock-service.bat --help start
C:/tools/pact/lib/app/pact-mock-service.rb:1:in
require': cannot load such file -- pact/mock_service/cli (LoadError) from C:/tools/pact/lib/app/pact-mock-service.rb:1:in
Steps to reproduce
Simply follow the Windows installation guide
Side notes
We tested it with colleague on Mac OS and it works perfectly fine
The text was updated successfully, but these errors were encountered: