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

After installing tiny_tds, the command tsql fails with an implicit conversion error #374

Closed
coderjoe opened this issue Jul 30, 2017 · 4 comments

Comments

@coderjoe
Copy link
Contributor

While testing #346 I found that tsql fails with the following error in 2.1.0.pre1:

root@freetds-test:~# tsql -C
[TinyTds][v2.1.0.pre1][tsql]: 
/var/lib/gems/2.3.0/gems/tiny_tds-2.1.0.pre1/bin/tsql:3:in `exit': no implicit conversion from nil to integer (TypeError)
        from /var/lib/gems/2.3.0/gems/tiny_tds-2.1.0.pre1/bin/tsql:3:in `<top (required)>'
        from /usr/local/bin/tsql:23:in `load'
        from /usr/local/bin/tsql:23:in `<main>'
root@freetds-test:~# tsql
[TinyTds][v2.1.0.pre1][tsql]: 
/var/lib/gems/2.3.0/gems/tiny_tds-2.1.0.pre1/bin/tsql:3:in `exit': no implicit conversion from nil to integer (TypeError)
        from /var/lib/gems/2.3.0/gems/tiny_tds-2.1.0.pre1/bin/tsql:3:in `<top (required)>'
        from /usr/local/bin/tsql:23:in `load'
        from /usr/local/bin/tsql:23:in `<main>'
root@freetds-test:~# tsql -H
[TinyTds][v2.1.0.pre1][tsql]: 
/var/lib/gems/2.3.0/gems/tiny_tds-2.1.0.pre1/bin/tsql:3:in `exit': no implicit conversion from nil to integer (TypeError)
        from /var/lib/gems/2.3.0/gems/tiny_tds-2.1.0.pre1/bin/tsql:3:in `<top (required)>'
        from /usr/local/bin/tsql:23:in `load'
        from /usr/local/bin/tsql:23:in `<main>'
root@freetds-test:~#
@coderjoe
Copy link
Contributor Author

coderjoe commented Jul 30, 2017

This seems to be because the bin.rb runner presumes that the tsql command will exist in the gem's exe directory. But that isn't true if we didn't build bundle and distribute it. This gets trickier since the tiny_tds gem forces the user to overwrite tsql as part of the install.

Maybe we should consider renaming the tiny_tds version of tsql to tinytds-tsql to avoid naming conflicts with the system tsql?

@metaskills
Copy link
Member

Maybe we should consider renaming the tiny_tds version of tsql to tinytds-tsql to avoid naming conflicts with the system tsql?

I think that is best. The main usage for these bins was defncopy since the SQL Server Rails adapter wanted to use this for schema structure dumps easier with Windows. But given that this utility can never replicate a true schema dumper, we should just remove both bin stubs from TinyTDS or rename them to something like defncopy-ttds or something. Related: rails-sqlserver/activerecord-sqlserver-adapter#437

@coderjoe
Copy link
Contributor Author

coderjoe commented Aug 3, 2017

Well I'd love to just remove them (deleting code is my favorite pastime), but given that the adapter depends on defncopy today I think I'm more in favor of a rename until something better can replace the tools.

@metaskills
Copy link
Member

Closing this because #377 is happening. Doing so does not diminish what the adapter needs, it just means people will have to wire up their $PATH as needed which is always a good thing.

metaskills pushed a commit that referenced this issue Sep 4, 2017
The previous names conflict with the built in FreeTDS executables
forcing you to overwrite them at gem install time. This solves the
problem by namespacing the executables to avoid the conflict until.

Resolves #374
aharpervc pushed a commit to aharpervc/tiny_tds that referenced this issue Apr 9, 2020
The previous names conflict with the built in FreeTDS executables
forcing you to overwrite them at gem install time. This solves the
problem by namespacing the executables to avoid the conflict until.

Resolves rails-sqlserver#374
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