purcell / sqlint

Simple SQL linter supporting ANSI and PostgreSQL syntaxes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to build gem native extension

dloret opened this issue · comments

Hello, please forgive me in advance if I'm doing a mistake as I'm quite new to using vim. I'm trying to install sqlint on windows 10. Installation on Fedora 23 on another machine worked fine but I can't install on Windows 10 for use with gvim 7.4.17.

I installed ruby and the ruby dev environment, as required. As far as I understood, the issue lies with this part of the file "extconf.rb" (located here for me: C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\pg_query-0.9.0\ext\pg_query):
unless File.exist?("#{workdir}/libpg_query.tar.gz") File.open("#{workdir}/libpg_query.tar.gz", 'wb') do |target_file| open('https://codeload.github.com/lfittl/libpg_query/tar.gz/' + LIB_PG_QUERY_TAG, 'rb') do |read_file| target_file.write(read_file.read) end end end

I can successfully download the tar.gz file manually (recreating the url with LIB_PG_QUERY_TAG = '9.5-1.1.0'). But when I run "gem install sqlint", I get the following error message and this repository (C:\Ruby23-x64\lib\ruby\gems\2.3.0\gems\pg_query-0.9.0\ext\pg_query) contains an empty file ((libpg_query.tar.gz => 0KB).

`C:\Users\I079276>gem install sqlint
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing sqlint:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/pg_query-0.9.0/ext/pg_query

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160419-8976-1lc4v5i.rb extconf.rb
*** 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:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in connect_nonblock': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:inconnect'
from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:863:in do_start' from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:852:instart'
from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:319:in open_http' from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:737:inbuffer_open'
from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:212:in block in open_loop' from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:210:incatch'
from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:210:in open_loop' from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:151:inopen_uri'
from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:717:in open' from C:/Ruby23-x64/lib/ruby/2.3.0/open-uri.rb:35:inopen'
from extconf.rb:15:in block in <main>' from extconf.rb:14:inopen'
from extconf.rb:14:in `

'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/pg_query-0.9.0 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/pg_query-0.9.0/gem_make.out`

The last double-dashed line (beginning with ruby=C:/...) contains what looks like an error related to a certificate: state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
Is there a link with the fact SSLv3 is now considered insecure and generally blocked ?

I hope it's not a bad setup on my side that I would not be aware of and that I'm not simply make you lose your time...

Thanks guys, Donatien

Sorry, not sure. I don't have a Windows machine. After a little Googling, it looks like an issue with Rubygems and your local certificate store. There's a chance this might help: https://gist.github.com/luislavena/f064211759ee0f806c88

While installation of slint on windows: ( Local installation .gem is done, but still same problem),

gem install sqlint
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing sqlint:
ERROR: Failed to build gem native extension.

current directory: D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/pg_query-0.13.5/ext/pg_query

D:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180320-15916-h6yech.rb extconf.rb
*** 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=D:/Ruby24-x64/bin/$(RUBY_BASE_NAME)
extconf.rb:22:in `

': ERROR (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/pg_query-0.13.5 for inspection.
Results logged to D:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/pg_query-0.13.5/gem_make.out

@lakshmanavula As the message says, this is the pg_query gem failing to install: it's a dependency of sqlint. Take a look at the build output file, the path to which was printed in the above messages, and if that doesn't give you a clue, you can check with the pg_query authors.