rails-sqlserver / tiny_tds

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

Cannot use tiny_tds on Rails 6.0 #454

Closed ChileNeverDie closed 4 years ago

ChileNeverDie commented 4 years ago

I'm wondering whether this problem is because I'm using Rails 6...The description as follows:

Environment

Operating System I'm using the Rails 6.0.2.1 & ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux] on AWS Ubuntu

TinyTDS Version and Information

ubuntu:~/environment/SEQuality (master) $ tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v1.00.82
             freetds.conf directory: /etc/freetds
     MS db-lib source compatibility: no
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 4.2
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: yes
                            OpenSSL: no
                             GnuTLS: yes
                               MARS: no

And tiny_tds version 2.1.2

ubuntu:~/environment/SEQuality (master) $ gem install tiny_tds
Building native extensions. This could take a while...
Successfully installed tiny_tds-2.1.2
1 gem installed

Description

I'm developing an website on Ubuntu(AWS), I need to transact with the sqlserver, I just cannot login since the error like this always happens:

ubuntu:~/environment/SEQuality (master) $ rails server
Traceback (most recent call last):
        70: from bin/rails:3:in `<main>'
        69: from bin/rails:3:in `load'
        68: from /home/ubuntu/environment/SEQuality/bin/spring:15:in `<top (required)>'
        67: from /home/ubuntu/environment/SEQuality/bin/spring:15:in `require'
        66: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
        65: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
        64: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
        63: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
        62: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
        61: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
        60: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
        59: from /home/ubuntu/environment/SEQuality/bin/rails:9:in `<top (required)>'
        58: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        57: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        56: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
        55: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        54: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        53: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        52: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        51: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        50: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.2.1/lib/rails/commands.rb:18:in `<main>'
        49: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.2.1/lib/rails/command.rb:46:in `invoke'
        48: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.2.1/lib/rails/command/base.rb:69:in `perform'
        47: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        46: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        45: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        44: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `perform'
        43: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:138:in `tap'
        42: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.2.1/lib/rails/commands/server/server_command.rb:141:in `block in perform'
        41: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        40: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        39: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
        38: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        37: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        36: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        35: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        34: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        33: from /home/ubuntu/environment/SEQuality/config/application.rb:7:in `<main>'
        32: from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler.rb:114:in `require'
        31: from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require'
        30: from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each'
        29: from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:76:in `block in require'
        28: from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:76:in `each'
        27: from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:81:in `block (2 levels) in require'
        26: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        25: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        24: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        23: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        22: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        21: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-sqlserver-adapter-2.3.8/lib/activerecord-sqlserver-adapter.rb:1:in `<main>'
        20: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        19: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
        18: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
        17: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        16: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        15: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        14: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        13: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        12: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter.rb:3:in `<main>'
        11: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `require'
        10: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:291:in `load_dependency'
         9: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.2.1/lib/active_support/dependencies.rb:325:in `block in require'
         8: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
         7: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
         6: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         5: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
         4: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         3: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:145:in `<main>'
         2: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:145:in `include'
         1: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:12:in `included'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activerecord-sqlserver-adapter-2.3.8/lib/active_record/connection_adapters/sqlserver_adapter/core_ext/active_record.rb:13:in `singleton class': undefined method `alias_method_chain' for #<Class:ActiveRecord::Base> (NoMethodError)
Did you mean?  alias_method
wpolicarpo commented 4 years ago

This has nothing to do with tiny_tds but due to the fact that the SQL Server adapter is not ready for Rails 6 yet.

See https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/690 for more information.