Skip to content

tiny_tds's executable "defncopy" conflicts with /usr/local/bin/defncopy #356

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

Closed
ghost opened this issue May 3, 2017 · 7 comments
Closed

Comments

@ghost
Copy link

ghost commented May 3, 2017

Hi All

I'm trying to setup tiny_tds on an Ubuntu 16.04 system and have run into an issue when installing the tiny_tds gem

FreeTDS has been installed on the system via the install method from the front page

wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz
tar -xzf freetds-1.00.27.tar.gz
cd freetds-1.00.27
./configure --prefix=/usr/local --with-tdsver=7.3
make
make install

When checking the version of the install I get

root@38998c93ed81:/# tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v1.00.27
             freetds.conf directory: /usr/local/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.3
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no
                            OpenSSL: no
                             GnuTLS: no
                               MARS: no

and on install of tiny_tds I get

root@38998c93ed81:/# gem install tiny_tds
Fetching: mini_portile2-2.1.0.gem (100%)
Successfully installed mini_portile2-2.1.0
Fetching: tiny_tds-1.3.0.gem (100%)
Building native extensions.  This could take a while...
tiny_tds's executable "defncopy" conflicts with /usr/local/bin/defncopy
Overwrite the executable? [yN]

Obviously I can hit y to acknowledge the prompt but this is a prelude to me building a docker image that I want to build.

So my question is, is this behavior normal? or have I done / missed something on the install ?

Thanks
Lee

@ghost
Copy link
Author

ghost commented May 3, 2017

So I'm new to ruby, gems etc and found that I can force the install using
gem install -f tiny_tds

but now that I've done that I get the following running tsql -C

root@38998c93ed81:/usr/local/bin# gem install -f tiny_tds
Building native extensions.  This could take a while...
Successfully installed tiny_tds-1.3.0
Parsing documentation for tiny_tds-1.3.0
Installing ri documentation for tiny_tds-1.3.0
Done installing documentation for tiny_tds after 0 seconds
1 gem installed
root@38998c93ed81:/usr/local/bin# tsql -C
[TinyTds][v1.3.0][tsql]:
/var/lib/gems/2.3.0/gems/tiny_tds-1.3.0/bin/tsql:3:in `exit': no implicit conversion from nil to integer (TypeError)
        from /var/lib/gems/2.3.0/gems/tiny_tds-1.3.0/bin/tsql:3:in `<top (required)>'
        from /usr/local/bin/tsql:23:in `load'
        from /usr/local/bin/tsql:23:in `<main>'
root@38998c93ed81:/usr/local/bin#

am thinking I've messed up the install somehow but not sure where..

@metaskills
Copy link
Member

So my question is, is this behavior normal? or have I done / missed something on the install ?

Hmmm... I have not considered that the bin stub wrapper of the same name would conflict like that. No to overwrite would be the right answer. I would uninstall FreeTDS and the gems, then re-install in that order and not overwrite the FreeTDS bins with the gem bin wrappers and go from there.

To check your work, use IRB and make a test connection. The tsql and wrapper friend are convinces, them not working does not stop TinyTDS from working. HTH.

@ghost
Copy link
Author

ghost commented May 8, 2017

@metaskills Appreciate the quick response!

So doing the uninstall and re-install didn't work. Run into the same problem. did some searching to see if there was any other way of connecting to SQL Server other than tiny_tds (sorry) and found a Microsoft doc on it (link below) that uses tiny_tds and saw that they were installing ruby using rvm. I had used apt-get install rubydev - so tried using RVM to install Ruby, then freetds-dev and freetds-bin followed by tiny_tds and it's worked. So am guessing that the install of ruby was imported somehow?

Still, am up and running so happy days!

https://docs.microsoft.com/en-us/sql/connect/ruby/step-1-configure-development-environment-for-ruby-development

@ghost ghost closed this as completed May 8, 2017
@metaskills metaskills reopened this May 8, 2017
@metaskills
Copy link
Member

Hmmm... I have not considered that the bin stub wrapper of the same name would conflict

Re-opening so I can remember to work on the binstubs.

@brentdodell
Copy link

I'm getting this same error on a Mac, with rbenv & ruby 2.4...

[TinyTds][v1.3.0][tsql]:
/Users/myuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/tiny_tds-1.3.0/bin/tsql:3:in `exit': no implicit conversion from nil to integer (TypeError)
        from /Users/myuser/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/tiny_tds-1.3.0/bin/tsql:3:in `<top (required)>'
        from /Users/myuser/.rbenv/versions/2.4.0/bin/tsql:22:in `load'
        from /Users/myuser/.rbenv/versions/2.4.0/bin/tsql:22:in `<main>'

Any idea when a fix will be available, or a workaround in the meantime?

@metaskills
Copy link
Member

Can you do an install of the gem with a no-op bin dir?

$ gem install tiny_tds --bindir /dev/null

@metaskills
Copy link
Member

PR #377 addresses this. Use 2.1.0.pre2 to test it out.

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

2 participants