rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
607 stars 189 forks source link

Please prepare tiny_tds gem for Ruby v2.6 on Windows #434

Closed TheR2 closed 3 years ago

TheR2 commented 5 years ago

Windows 10

ERROR: Error installing tiny_tds: The last version of tiny_tds (>= 0) to support your Ruby & RubyGems was 2.1.2. Try installing it with gem install tiny_tds -v 2.1.2 tiny_tds requires Ruby version >= 2.0, < 2.6. The current ruby version is 2.6.1.33.

Thank you TheR

aharpervc commented 5 years ago

Huh, looks like the rake task might need to be updated to match the ruby versions we're testing in CI

https://github.com/rails-sqlserver/tiny_tds/blob/master/tasks/native_gem.rake#L11 lists 2.5.0, 2.4.0, 2.3.0, 2.2.2, 2.1.6, and 2.0.0 whereas https://github.com/rails-sqlserver/tiny_tds/blob/master/appveyor.yml lists 2.3 through 2.6.

I can't think of any reason for those lists to be different, to be honest.

avinashsa commented 5 years ago

folks, what does this mean, "gem install" still complains about this error on windows 10. Was this fixed ? if no when is it available ?

will commented 5 years ago

Yeah I can confirm that you can't install using ruby 2.6 on windows

mrambossek commented 4 years ago

any updates - is there a workaround? thanks

aharpervc commented 4 years ago

Did you try building the gem after updating the rake task to include 2.6 as I described above?

mrambossek commented 4 years ago

Did you try building the gem after updating the rake task to include 2.6 as I described above?

sorry i dont know how to do that. i did a git checkout, and then ran "gem build tiny_tds.gemspec", which produced a tiny_tds-2.1.2.gem which i then installed via "gem install". however now i appearently dont have any of those tinytds static libraries? not sure. what are the steps necessary to get or build those tinytds libraries?

aharpervc commented 4 years ago

what are the steps necessary to get or build those tinytds libraries?

Please review the instructions in the readme file. If you're on Windows, the simplest way is to use docker to set up the build environment. https://github.com/rails-sqlserver/tiny_tds#compiling-gems-for-windows

mrambossek commented 4 years ago

Please review the instructions in the readme file. If you're on Windows, the simplest way is to use docker to set up the build environment. https://github.com/rails-sqlserver/tiny_tds#compiling-gems-for-windows

tried this, i think im on the right track, but the build fails somewhere on openssl?

C:\Users\mram.AD\tiny_tds>rake gem:windows
tasks/ports.rake:9: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
rake-compiler-dock bash -c "bundle && rake ports:compile[i686-w64-mingw32] MAKE='make -j`nproc`' && rake ports:compile[x86_64-w64-mingw32] MAKE='make -j`nproc`'"
Fetching gem metadata from https://rubygems.org/.............
Fetching rake 10.5.0
Installing rake 10.5.0
Using bundler 2.0.1
Fetching connection_pool 2.2.2
Installing connection_pool 2.2.2
Using mini_portile2 2.4.0
Fetching minitest 5.12.2
Installing minitest 5.12.2
Fetching rake-compiler 1.0.8
Installing rake-compiler 1.0.8
Fetching rake-compiler-dock 0.6.3
Installing rake-compiler-dock 0.6.3
Using tiny_tds 2.1.2 from source at `.`
Bundle complete! 7 Gemfile dependencies, 8 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
tasks/ports.rake:9: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
Compiling ports for i686-w64-mingw32...
Extracting openssl-1.1.0j.tar.gz into tmp/i686-w64-mingw32/ports/openssl/1.1.0j... OK
Running 'configure' for openssl 1.1.0j... OK
Running 'compile' for openssl 1.1.0j... OK
Running 'install' for openssl 1.1.0j... ERROR, review '/c/Users/mram.AD/tiny_tds/tmp/i686-w64-mingw32/ports/openssl/1.1.0j/install.log' to see what happened. Last lines are:
========================================================================
created directory `/c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl'
created directory `/c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/certs'
created directory `/c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/private'
created directory `/c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/misc'
install ./apps/CA.pl -> /c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/misc/CA.pl
make[1]: Entering directory '/c/Users/mram.AD/tiny_tds/tmp/i686-w64-mingw32/ports/openssl/1.1.0j/openssl-1.1.0j'
make[1]: Leaving directory '/c/Users/mram.AD/tiny_tds/tmp/i686-w64-mingw32/ports/openssl/1.1.0j/openssl-1.1.0j'
install ./apps/tsget -> /c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/misc/tsget
make[1]: warning: -jN forced in submake: disabling jobserver mode.
install ./apps/openssl.cnf -> /c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/openssl.cnf.dist
install ./apps/openssl.cnf -> /c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/ssl/openssl.cnf
*** Installing runtime files
install libcrypto-1_1.dll -> /c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/bin/libcrypto-1_1.dll
cp: cannot create regular file '/c/Users/mram.AD/tiny_tds/ports/i686-w64-mingw32/openssl/1.1.0j/bin/libcrypto-1_1.dll.new': No such file or directory
Makefile:382: recipe for target 'install_runtime_libs' failed
make: *** [install_runtime_libs] Error 1
make: *** Waiting for unfinished jobs....
make[1]: Entering directory '/c/Users/mram.AD/tiny_tds/tmp/i686-w64-mingw32/ports/openssl/1.1.0j/openssl-1.1.0j'
make[1]: Nothing to be done for '_build_programs'.
make[1]: Leaving directory '/c/Users/mram.AD/tiny_tds/tmp/i686-w64-mingw32/ports/openssl/1.1.0j/openssl-1.1.0j'
========================================================================
rake aborted!
Failed to complete install task
/usr/local/rvm/gems/ruby-2.5.3/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:402:in `block in execute'
/usr/local/rvm/gems/ruby-2.5.3/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in `chdir'
/usr/local/rvm/gems/ruby-2.5.3/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:373:in `execute'
/c/Users/mram.AD/tiny_tds/tasks/ports/openssl.rb:43:in `execute'
/c/Users/mram.AD/tiny_tds/tasks/ports/openssl.rb:24:in `install'
/usr/local/rvm/gems/ruby-2.5.3/gems/mini_portile2-2.4.0/lib/mini_portile2/mini_portile.rb:155:in `cook'
/c/Users/mram.AD/tiny_tds/tasks/ports/recipe.rb:12:in `cook'
tasks/ports.rake:23:in `block (2 levels) in <top (required)>'
tasks/ports.rake:66:in `block (3 levels) in <top (required)>'
tasks/ports.rake:65:in `each'
tasks/ports.rake:65:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => ports:openssl
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [docker run -v /c/Users/mram.AD/tiny_tds:/c/Users/mram.AD/tiny_tds -e UID\=1000 -e GID\=1000 -e USER\=mram -e GROUP\=dummygroup -e ftp_proxy\= -e http_proxy\= -e https_proxy\= -e RCD_HOST_RUBY_PLATFORM\=x64-mingw32 -e RCD_HOST_RUBY_VERSION\=2.6.4 -e RCD_IMAGE\=larskanis/rake-compiler-dock-mri:0.7.2 -w /c/Users/mram.AD/tiny_tds --rm -i -t larskanis/rake-compiler-dock-mri:0.7.2 runas sigfw bash -c bundle\ \&\&\ rake\ ports:compile\[i686-w64-mingw32\]\ MAKE\=\'make\ -j\`nproc\`\'\ \&\&\ rake\ ports:compile\[x86_64-w64-mingw32\]\ MAKE\=\'make\ -j\`nproc\`\']
tasks/ports.rake:82:in `block (2 levels) in <top (required)>'
Tasks: TOP => gem:windows => ports:cross
(See full trace by running task with --trace)

install.log

aharpervc commented 4 years ago

Ah yes, openssl is a giant headache. Try changing this line to something else, such as 1.1.0e

But also more generally for this issue, it might also be useful to update the travis ci config to enable downloading built gems, so that people can more easily test PR artifacts without building locally themselves.

crazycajun commented 4 years ago

Any chance a Ruby 2.6 version of the pre-compiled Windows gem getting pushed to rubygems soon? I have a client that needs to upgrade to a patched version or Ruby and this is holding them up.

aharpervc commented 4 years ago

I have pushed 2.1.3-pre to rubygems for testing. Interested parties should install it & verify it works in ruby 2.6 with their app

Reppinger commented 4 years ago

Thanks @aharpervc. I have run a very limited test of a cucumber project that does table truncation and basic record insert using tiny_tds (~> 2.1.3.pre) on Windows using ruby 2.6.6p146, activerecord-sqlserver-adapter (5.2.1) and active record (5.2.4.2). Worked with Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64).

ecentell-CPF commented 4 years ago

If any resources can examine #465 and provide input, this would be appreciated.

aharpervc commented 3 years ago

2.1.3 has now been released