Open ElectricRCAircraftGuy opened 6 months ago
Reinstalling poppler
in an Admin terminal with choco install --force poppler
did not fix the problem.
rga
with scoop
instead of with choco
!Update: installing with scoop
seems to fix it! I wonder if scoop installs a later version of poppler? Here is the version of poppler
that scoop
installed:
Installing 'poppler' (24.02.0-0) [64bit] from 'main' bucket
Release-24.02.0-0.zip (14.2 MB) [===============================================================] 100%
Checking hash of Release-24.02.0-0.zip ... ok.
Extracting Release-24.02.0-0.zip ... done.
Linking ~\scoop\apps\poppler\current => ~\scoop\apps\poppler\24.02.0-0
Creating shim for 'pdfattach'.
Creating shim for 'pdfdetach'.
Creating shim for 'pdffonts'.
Creating shim for 'pdfimages'.
Creating shim for 'pdfinfo'.
Creating shim for 'pdfseparate'.
Creating shim for 'pdftocairo'.
Creating shim for 'pdftohtml'.
Creating shim for 'pdftoppm'.
Creating shim for 'pdftops'.
Creating shim for 'pdftotext'.
Creating shim for 'pdfunite'.
'poppler' (24.02.0-0) was installed successfully!
rga
via scoop
Install scoop
: in a non-admin PowerShell, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Source: https://scoop.sh/
Install rga
via scoop
: in a non-admin PowerShell, run:
# Install rga (ripgrep-all)
scoop install rga
# Install fzf too while we are at it
scoop install fzf
Source: https://github.com/phiresky/ripgrep-all?tab=readme-ov-file#scoop
Now it works!
Example run and output, as expected:
Git Bash terminal:
gstaples@my-pc MINGW64 ~/temp
$ rga my dummy.pdf
Page 1: Dummy PDF file
Screenshot so you can see where my
was found:
PowerShell terminal:
PS C:\Users\gstaples\temp> rga my .\dummy.pdf
Page 1: Dummy PDF file
Command Prompt:
C:\Users\gstaples\temp>rga my dummy.pdf
Page 1: Dummy PDF file
I also quoted the above in my answer here: Stack Overflow: How to install ripgrep on Windows?
I guess this is a problem with chocolately then, you had a version of pdftotext not from the poppler project.
Came here after I got the same error with Chocolatey install.
Removed the choco install, tried the scoop install: still the same error and scoop does not solve it.
rg: .\mydoc.pdf: preprocessor command failed: '"C:\\Users\\Username\\scoop\\apps\\rga\\current\\rga-preproc" ".\\mydoc.pdf"':
-------------------------------------------------------------------------------
C:\Users\Username\mydoc.pdf adapter: poppler
C:\Users\Username\mydoc.pdf.txt.asciipagebreaks adapter: postprocpagebreaks
Error: copying adapter output to stdout
Caused by:
0: adapting C:\Users\Username\mydoc.pdf.txt.asciipagebreaks via postprocpagebreaks failed
1: subprocess: Command { std: "pdftotext" "-" "-", kill_on_drop: false }
2: ExitStatus(ExitStatus(3221225781))
-------------------------------------------------------------------------------
Describe the bug
It fails to search any PDF.
Error it gives me:
Example run and output in the Git Bash terminal:
Example run and output in Command Prompt:
To Reproduce
Note: if you don't have
choco
(Chocolatey) installed, you can first install it by running this as an admin in PowerShell:Source: https://chocolatey.org/install
Next:
rga my dummy.pdf
to try to search dummy.pdf for the word "my".If on Windows 10 Pro, you'll also need to install vc_redist.x64.exe, as the instructions say here: https://github.com/phiresky/ripgrep-all?tab=readme-ov-file#windows
If on Windows 11 Pro, you won't.
If on Windows 10 Pro running in the Command Prompt, you may see this error pop up:
If on Windows 10 Pro running in the Git Bash terminal, you will not see this error.
Attach example file:
dummy.pdf
Run command:
Output
See above.
Screenshots
If applicable, add screenshots to help explain your problem.
See above.
Operating System and Version
Tested in Windows 10 Pro and in Windows 11 Pro. Same result in both.
Output of
rga --version