ruby-gpgme
ruby-gpgme copied to clipboard
Cannot install on Windows
Sorry if this is completely not supported, but we have a rails project (Ruby 1.8.7, Rails 3.2.8) that uses gpgme for signature verification. The production environment is Linux, but we have some developers working on Windows.
Is this gem even supported on Windows?
If so, what are the installation instructions?
My environment: Windows 7 Pro 64-bit ruby 1.8.7 (2012-06-29 patchlevel 370) [i386-mingw32]
C:>gem install gpgme Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing gpgme: ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb -- tar xjvf C:/Ruby187/lib/ruby/gems/1.8/gems/gpgme-2.0.1/ext/gpgme/libgpg-error-1.10.tar.bz2 *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby
extconf.rb:11:in sys': tar xjvf C:/Ruby187/lib/ruby/gems/1.8/gems/gpgme-2.0.1/ext/gpgme/libgpg-error-1.10.tar.bz2 failed! (RuntimeError) from extconf.rb:18:inbuild'
from extconf.rb:33
Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/gpgme-2.0.1 for inspection. Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/gpgme-2.0.1/ext/gpgme/gem_make.out
Hi, I'm stuck with the same issue. Did you get this solved for windows?
Nope, never got resolved. We've since upgraded to ruby 2 and rails 4 which I couldn't get to install properly on windows. I gave up and just installed Vitual Bix and an Ubuntu VM and I'm much happier now.
Perhaps we could adopt rake-compiler and generate native gems for Windows. If anyone is willing to work on the port, I'd appreciate it.
Hi, I also have the same problem. I'm running Ruby 1.9.3 and Windows Server 2008 R2
Having dug into things a bit with #81, the libgpg-error upstream code doesn't appear to take windows as a consideration. I'm not sure where the responsibility would go, but if you look around the internet a bit getting gpgme to work under windows natively appears to be non-trivial. Even this package's development build process makes assumptions like gpgme-config existing (which it doesn't under windows).
has anybody found a solution?
The issue seems to be that the sys/wait.h header is needed (by spawn-posix.c). But while MSYS2 has this header, MINGW64 does not, and Ruby seems to use MINGW64. So I guess it is an upstream portability issue.
I needed to setup a Ruby development environment on my machine to fix a bug in dependabot that was bothering me when I ran into this issue. I was able to solve the issue for me with following steps:
- Uninstall the 64bit version of Ruby and use 32bit one.
- Launch the msys2 shell ("C:\Ruby31\msys32\msys2.exe")
- install the required headers and libs using
pacman -S msys2-runtime-devel - Retry to install gpgme.
For me it's not a big deal to use the 32bit version. On the 64bit version I couldn't get it running. Somehow the include paths were not correctly setup or msys2-runtime-devel is even 32bit only? Maybe for some people this is a workaround.
Sidenote: Got compilation errors on stackprof after that 😅