Skip to content
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

TinyTDS 1.0.5 won't install #312

Closed
bradenwright opened this issue Oct 20, 2016 · 9 comments
Closed

TinyTDS 1.0.5 won't install #312

bradenwright opened this issue Oct 20, 2016 · 9 comments

Comments

@bradenwright
Copy link

On Ubuntu 14.04, trying to install tiny_tds (on sensu server) and I'm getting an error about openssl missing. I've tried things like installing 'openssl', 'freetds-dev', 'freetds-common', 'freetds-bin' non of them seem to help. Seems like I'm missing a package dependency!

/opt/sensu/embedded/bin/gem install tiny_tds
Building native extensions.  This could take a while...
ERROR:  Error installing tiny_tds:
    ERROR: Failed to build gem native extension.

    current directory: /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/tiny_tds-1.0.5/ext/tiny_tds
/opt/sensu/embedded/bin/ruby -r ./siteconf20161020-7522-1v12dq0.rb extconf.rb
extconf.rb:14: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... yes
checking for dbanydatecrack() in -lsybdb... no
Downloading freetds-1.00.15.tar.bz2 (100%) 
Extracting freetds-1.00.15.tar.bz2 into tmp/x86_64-pc-linux-gnu/ports/freetds/1.00.15... OK
Running patch with /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/tiny_tds-1.0.5/ports/patches/freetds/1.00.15/0001-mingw_missing_inet_pton.diff... OK
Running 'configure' for freetds 1.00.15... ERROR, review '/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/tiny_tds-1.0.5/ext/tiny_tds/tmp/x86_64-pc-linux-gnu/ports/freetds/1.00.15/configure.log' to see what happened. Last lines are:
========================================================================
checking for strtok_r... yes
checking for readpassphrase... no
checking for strlcpy... no
checking for strlcat... no
checking for basename... yes
checking for getopt... yes
checking for strsep... yes
checking for daemon... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for library containing clock_gettime... none required
checking if clock_gettime support CLOCK_MONOTONIC... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether malloc_options variable is present... no
checking compile-time options
configure: odbc disabled
checking if openssl is wanted... yes
checking for OPENSSL... no
configure: error: Cannot find OpenSSL libraries
========================================================================
*** 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
    --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=/opt/sensu/embedded/bin/$(RUBY_BASE_NAME)
    --help
    --enable-lookup
    --disable-lookup
    --with-freetds-dir
    --without-freetds-dir
    --with-freetds-include
    --without-freetds-include=${freetds-dir}/include
    --with-freetds-lib
    --without-freetds-lib=${freetds-dir}/lib
    --with-sybdblib
    --without-sybdblib
    --with-sybdblib
    --without-sybdblib
    --enable-system-freetds
    --disable-system-freetds
    --enable-system-iconv
    --disable-system-iconv
    --enable-system-openssl
    --disable-system-openssl
    --enable-gnutls
    --disable-gnutls
    --enable-openssl
    --disable-openssl
/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete configure task (RuntimeError)
    from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `chdir'
    from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `execute'
    from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:106:in `configure'
    from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:149:in `cook'
    from extconf.rb:128:in `block in cook_and_activate'
    from extconf.rb:120:in `block in chdir_for_build'
    from extconf.rb:119:in `chdir'
    from extconf.rb:119:in `chdir_for_build'
    from extconf.rb:127:in `cook_and_activate'
    from extconf.rb:321:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /opt/sensu/embedded/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/tiny_tds-1.0.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/tiny_tds-1.0.5 for inspection.
Results logged to /opt/sensu/embedded/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/tiny_tds-1.0.5/gem_make.out
@bradenwright
Copy link
Author

FYI... I was able to get it to install via:

gem install tiny_tds -- --disable-openssl but would prefer install openssl and leave it enabled.

@metaskills
Copy link
Contributor

When you created the issue, did you see this question in the template?

Using Ubuntu? If so, you may have forgotten to install FreeTDS first.

Can you tell me if you installed FreeTDS at the system level and built it in such a way that has OpenSSL? I am guessing no since that flag is only used when the gem tries to download and statically build a version of FreeTDS and OpenSSL. Which is something really only meant for Windows.

@bradenwright
Copy link
Author

Yes I have:

I've tried things like installing 'openssl', 'freetds-dev', 'freetds-common', 'freetds-bin'

@metaskills
Copy link
Contributor

So when you did that, what happens when you run tsql -C now?

@RyanSnodgrass
Copy link

RyanSnodgrass commented Nov 4, 2016

I have this same issue on Centos 6. tiny_tds > v1.0 has a dependency on freetds v.94

The RPM EPEL packages for Centos 6, seen in this tutorial, this stackoverflow, and this tutorial don't go past .91. Making this install very difficult. There isn't enough support that I could find to upgrade freetds without going through the EPEL. I ended giving up and downgrading the tiny_tds gem to gem 'tiny_tds', '0.9.5.rc.2'

@gkemmey
Copy link

gkemmey commented Nov 16, 2016

I was having similar issues on Ubuntu 14.04 using apt-get to install freetds-dev and freetds-bin. Running tsql -C seemed to indicate the FreeTDS version was 0.91.

Instead of using apt-get, I switched to just installing from source, YMMV:

set -ex \
  && wget -O freetds-1.00.15.tar.gz "ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.15.tar.gz" \
  && tar -xzvf freetds-1.00.15.tar.gz \
  && cd freetds-1.00.15 \
  && ./configure \
  && make \
  && sudo make install

@metaskills
Copy link
Contributor

Thanks @gkemmey for the notes.

I recently found this out while building SQL Server on Linux Docker images and integrating CircleCI (all now on master). Basically Ubuntu packages are way behind for FreeTDS. I found our our usage of Miniportile works just fine (thanks to CircleCI) assuming you have all the deps like build-essentials and libc6-dev.

But I also found that doing what @gkemmey suggested worked really well too. So I added these notes to the README. Closing this issue.

https://github.com/rails-sqlserver/tiny_tds#install

@wy193777
Copy link

wy193777 commented Jun 6, 2019

Got infinite ./configure.lineno: line 477: /home/gnu/bin/expr: No such file or directory when trying to run ./configure.

@daruns
Copy link

daruns commented Jan 31, 2020

if you are using ruby =< 2.2.0 you would run:
gem install tiny_tds -v '< 0.9' --source 'https://rubygems.org/'
or simply add it in your Gemfile:
gem 'tiny_tds', '< 0.9'
then run:
bunlde install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants