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

"Cannot load such file -- tiny_tds/tiny_tds" (version 1.1.0, version 1.0.0 is OK) #330

Closed
bradder555 opened this issue Jan 3, 2017 · 37 comments

Comments

@bradder555
Copy link

bradder555 commented Jan 3, 2017

Using Windows 7, Enterprise, with MS-SQL 2014 64-bit developer running locally

Using ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32] and
gem 2.4.5.1

SQL server authentication is enabled,
Named pipes and TCP is enabled,

tiny_tds installed (i get the exact same issue with the 32 bit version):

> gem list | grep tiny_tds
tiny_tds (1.1.0 x64-mingw32)

FreeTDS is installed:

>tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v1.00.9
             freetds.conf directory: c:
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: no
                        TDS version: 7.0
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: yes
                           Kerberos: no
                            OpenSSL: yes
                             GnuTLS: no
                               MARS: no

from irb i require tiny_tds and get:

irb(main):001:0> require 'tiny_tds'
LoadError: cannot load such file -- tiny_tds/tiny_tds
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-1.1.0-x64-mingw32/lib/tiny_tds.rb:22:in `rescue in <top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-1.1.0-x64-mingw32/lib/tiny_tds.rb:25:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from (irb):1
        from C:/RailsInstaller/Ruby2.2.0/bin/irb:11:in `<main>'

I modified the tiny_tds.rb file to get an idea of what is going on:

if RUBY_PLATFORM =~ /mingw|mswin/ && RUBY_VERSION =~ /(\d+.\d+)/
  ver = Regexp.last_match(1)
  # Set the PATH environment variable, so that the DLLs can be found.
  old_path = ENV['PATH']
  begin
    print "begin \n"
    # Do the same host consolidation as in extconf.rb
    ports_dir = RbConfig::CONFIG['host'].gsub('i686-pc-mingw32', 'i686-w64-mingw32')
    ENV['PATH'] = "#{File.expand_path("../../ports/#{ports_dir}/bin", __FILE__)};#{old_path}"
	print "ENV['PATH'] = ... \n"
	print "require \"tiny_tds/#{ver}/tiny_tds \n"
    require "tiny_tds/#{ver}/tiny_tds"
  rescue LoadError
	print "LoadError \n"
    require 'tiny_tds/tiny_tds'
  ensure
	print "ensure \n"
    ENV['PATH'] = old_path
  end
else

and get this:

irb(main):004:0> require 'tiny_tds'
begin
ENV['PATH'] = ...
require "tiny_tds/2.2/tiny_tds
LoadError
ensure
begin
ENV['PATH'] = ...
require "tiny_tds/2.2/tiny_tds
LoadError
ensure
LoadError: cannot load such file -- tiny_tds/tiny_tds
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:121:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-1.1.0-x64-mingw32/lib/tiny_tds.rb:26:in `rescue in <top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-1.1.0-x64-mingw32/lib/tiny_tds.rb:30:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from (irb):4
        from C:/RailsInstaller/Ruby2.2.0/bin/irb:11:in `<main>'
irb(main):005:0>

The path "tiny_tds/2.2/tiny_tds" contains:
tiny_tds.so

The tiny_tds folder contains:

  • 2.0 (folder, contains tiny_tds.so)
  • 2.1 (folder, contains tiny_tds.so)
  • 2.2 (folder, contains tiny_tds.so)
  • 2.3 (folder, contains tiny_tds.so)
  • 2.4 (folder, contains tiny_tds.so)
  • bin.rb
  • client.rb
  • error.rb
  • result.rb
  • version.rb

So not sure what i'm missing? is there meant to be a compilation step when importing the gem? because that doesn't appear to be happening

If I uninstall and reinstall:

>gem uninstall tiny_tds
Remove executables:
        defncopy, tsql

in addition to the gem? [Yn]  y
Removing defncopy
Removing tsql
Successfully uninstalled tiny_tds-1.1.0-x64-mingw32

>gem install tiny_tds
Fetching: tiny_tds-1.1.0-x86-mingw32.gem (100%)
Successfully installed tiny_tds-1.1.0-x86-mingw32
Parsing documentation for tiny_tds-1.1.0-x86-mingw32
Installing ri documentation for tiny_tds-1.1.0-x86-mingw32
Done installing documentation for tiny_tds after 1 seconds
1 gem installed

if i go irb and require, i get exactly the same issue.

@metaskills
Copy link
Member

is there meant to be a compilation step when importing the gem?

No. We push pre-compiled native gems for the Windows platform that have statically linked FreeTDS and friends to Rubygems. This is what we use Miniportile/Docker to accomplish. I suspect there is a gem install command that can ignore the platform detection but I would have to Google for it.

Not sure why you are having the require issue?

@bradder555 bradder555 changed the title "Cannot load such file -- tiny_tds/tiny_tds" "Cannot load such file -- tiny_tds/tiny_tds" (version 1.1.0, version 1.0.0 is OK) Jan 3, 2017
@coderjoe
Copy link
Contributor

coderjoe commented Jan 3, 2017

I notice that your tsql -C command says it's using freetds 1.00.9, which is interesting since tiny_tds 1.1.0 is compiled against its own patched version of 1.00.21.

Is there a chance you've installed your own copy of FreeTDS libraries are taking precidence over tiny_tds's version?

If you'd like a better picture of what's being loaded (or failing to load), you can install the Microsoft Sysinternals Suite and use procmon filtered only for load events in your freetds and ruby directories.

This will show you where it's looking for DLLs, what it's loading, and what it can't find. If it's loading openssl, libiconv, or freetds libraries external to the tiny_tds gem there's a chance they might be causing the problem.

It may also be a good idea to check the actual LoadError exception being thrown and caught in your modified gem to see what its exception actually says.

@bradder555
Copy link
Author

bradder555 commented Jan 3, 2017

I had installed freetds and put it on the path, i deleted it and removed the path reference, that didn't help though

(just confirmed, uninstalled v 1.0.0, reinstalled v 1.1.0, get the same issue)

@coderjoe
Copy link
Contributor

coderjoe commented Jan 3, 2017

Darned, there goes the easy solution. The next step is to actually debug the load error and try and find the source. Unfortunately I do not have any Windows 7 environments (enterprise or otherwise) to help test. Please do investigate and let us know what you find!

@bradder555
Copy link
Author

Yes will do! :)

@Insood
Copy link

Insood commented Jan 5, 2017

+1 for the same issue. Upgraded from 1.0.5 to 1.1.0.


C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tiny_tds-1.1.0-x86-mingw32/lib/tiny_tds.rb:22:in `require': cannot
load such file -- tiny_tds/tiny_tds (LoadError)
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tiny_tds-1.1.0-x86-mingw32/lib/tiny_tds.rb:22:in `resc
ue in <top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tiny_tds-1.1.0-x86-mingw32/lib/tiny_tds.rb:25:in `<top
 (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2
levels) in require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in
require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
        from V:/gpopov/Documents/Projects/BMS/config/application.rb:8:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.14/lib/rails/commands/commands_tasks.rb:7
9:in `require'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.14/lib/rails/commands/commands_tasks.rb:7
9:in `block in server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.14/lib/rails/commands/commands_tasks.rb:7
6:in `tap'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.14/lib/rails/commands/commands_tasks.rb:7
6:in `server'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.14/lib/rails/commands/commands_tasks.rb:4
0:in `run_command!'
        from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/railties-4.1.14/lib/rails/commands.rb:17:in `<top (req
uired)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

@metaskills
Copy link
Member

@Insood What is your platform/os?

@Insood
Copy link

Insood commented Jan 6, 2017

Hi! Sorry - got distracted.

It's Microsoft Windows 7 Professional (6.1.7601 Service Pack 1 Build 7601). Ruby is ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]. Everything was initially installed with rails installer some time ago.

Downgrading to 1.0.5 "fixes" things.

I have freeTDS installed in C:/FreeTDS

Compile-time settings (established with the "configure" script)
                            Version: freetds v0.91RC2
             freetds.conf directory: /mingw/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.0
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: no

However, it's not in the global PATH. Doing tsql -C gets me this:

W:\insood\Documents\Projects\BMS>tsql -C
[TinyTds][v1.1.0][tsql]: C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/tiny_tds-1.1.0-x86-mingw32/exe/tsql.EXE

@metaskills
Copy link
Member

@Insood Two things:

  • TinyTDS now requires at least 0.95 but you really should use latest 0.99 or better 1.x
  • Why worry about having FreeTDS installed at all? The Windows gems have TinyTDS statically linked.

@Insood
Copy link

Insood commented Jan 12, 2017

It looks like it may be an issue with LIBSYBDB-5.DLL.

I've opened up

A: C:\RailsInstaller\Ruby2.3.0\lib\ruby\gems\2.3.0\gems\tiny_tds-1.1.0-x86-mingw32\ports\i686-w64-mingw32\bin\libsybdb-5.dll
B: C:\RailsInstaller\Ruby2.3.0\lib\ruby\gems\2.3.0\gems\tiny_tds-1.0.5-x86-mingw32\ports\i686-w64-mingw32\bin\libsybdb-5.dll

And there's an error opening up (A) because it can't find "LIBGCC_S_SJLJ-1.DLL"

It does not look like LIBGCC_S_SJLJ-1.DLL is used by (B)

Dependency walker

@coderjoe
Copy link
Contributor

Thank you very much for the report. I'll take a peek shortly!

@coderjoe
Copy link
Contributor

coderjoe commented Jan 13, 2017

@Insood Do you happen to have the DevKit installed for your version of the RubyInstaller? I'm working off a theory that it works on all my test machines because the library is provided by the devkit but not the base installer...

Can you please confirm the following:

  1. Are you running RubyInstaller-x32 on a 64bit architecture?
  2. You do not have devkit installed

If so I think I have a reproduction case and can begin debugging. :)

@coderjoe
Copy link
Contributor

@Insood if you get a moment could you please confirm or deny the above assumptions? It could save me hours and hours of testing if you could. :)

@Insood
Copy link

Insood commented Jan 18, 2017

Hi @coderjoe ,

Sorry for late response. I'm running the following:

ruby:
bin: C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe
version: ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

rails:
bin: C:/RailsInstaller/Ruby2.0.0/bin/rails.bat
version: Rails 5.0.1

Windows:
version: Microsoft Windows 7 Professional (6.1.7601 Service Pack 1 Build 7601).
bits: 64

RailsInstaller comes with devkit (C:\RailsInstaller\DevKit). There's a C:\RailsInstaller\DevKit\mingw\bin\libgcc_s_sjlj-1.dll

My PATH has the following:

PATH=C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.3.0\bin;C:\RailsInstaller
\Ruby2.3.0\lib\ruby\gems\1.9.1\bin;C:\RailsInstaller\DevKit\bin;C:\ImageMagick-7
.0.2-Q16;C:\Program Files\ImageMagick-7.0.2-Q16;C:\Users\insood\AppData\Local\En
thought\Canopy\User\Lib\site-packages\PyQt4;C:\Program Files (x86)\NVIDIA Corpor
ation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C
:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\syst
em32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v
1.0;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7
IDE;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;c:\Program File
s\Microsoft SQL Server\100\Tools\Binn;c:\Program Files (x86)\Microsoft SQL Serv
er\100\DTS\Binn;C:\Program Files\nodejs;c:\Program Files\Microsoft SQL Server
100\DTS\Binn;c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\Pri
vateAssemblies;C:\Program Files (x86)\Skype\Phone;C:\Program Files\Microsoft S
QL Server\120\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Perform
ance Toolkit;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin;C:\Prog
ram Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft
SQL Server\Client SDK\ODBC\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL
Server\130\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn
;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio;C:
\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.3.0\bin;C:\Users\insood\AppData
Local\Enthought\Canopy\User;C:\Users\insood\AppData\Local\Enthought\Canopy\User
Scripts;C:\Users\insood\AppData\Roaming\npm

@metaskills
Copy link
Member

@Insood Did you make sure to uninstall that unsupported v0.91RC2 version?

@coderjoe
Copy link
Contributor

@Insood interesting. That helps a lot. I'll try reproducing within RailsInstaller instead of just RubyInstaller. I'm surprised it's failing with DevKit installed since that solved it using RubyInstaller.

You've given me more than enough information to debug the problem and I think I can set up a good reproduction case. Thank you very much!

I'll set aside some hack-time this weekend to see what I can do to resolve the error. :)

@coderjoe
Copy link
Contributor

coderjoe commented Jan 19, 2017

@Insood I can't seem to reproduce your problem with RailsInstaller but I have managed to reproduce it with RubyInstaller-x32 on x64 without devkit.

While I'm working on this I noticed something, your Ruby path says it's version 2.0.0 but your PATH seems to say you have 2.3.0. Do you have more than one version of RubyInstaller version installed as well?

@Insood
Copy link

Insood commented Jan 19, 2017

@metaskills, FreeTDS has been uninstalled (somehow I had two installations - one in C:/ and one in C:/Program Files) - still nothing.

@coderjoe, that was the output from opening up the "Command Prompt with Ruby and Rails".bat file which has a target of: C:\Windows\System32\cmd.exe /E:ON /K C:\RailsInstaller\Ruby2.3.0\setup_environment.bat C:\RailsInstaller

I only have 2.3.0 installed. I had a previous version (2.1.0) at one point, but did a clean uninstall/reinstall.

I typically just use the regular command prompt.

That .bat file looks like this:

@ECHO OFF

REM
REM Environment setup file for RailsInstaller.
REM

REM
REM First we determine where is RUBY_DIR (which is where this script is)
REM
PUSHD %~dp0.
SET RUBY_DIR=%CD%
POPD

REM
REM Now determine the RailsInstaller root directory (parent directory of Ruby)
REM
PUSHD %RUBY_DIR%\..
SET ROOT_DIR=%CD%
POPD

REM
REM Add RUBY_DIR\bin to the PATH, DevKit\bin and then Git\cmd
REM RUBY_DIR\bin takes higher priority to avoid other tools conflict
REM
SET PATH=%RUBY_DIR%\bin;%RUBY_DIR%\lib\ruby\gems\1.9.1\bin;%ROOT_DIR%\DevKit\bin;%PATH%
IF EXIST %ROOT_DIR%\Git\cmd SET PATH=%ROOT_DIR%\Git\cmd;%PATH%
SET RUBY_DIR=
SET ROOT_DIR=

REM
REM Create the %HOMEDRIVE%\Sites directory.
REM
IF NOT EXIST %HOMEDRIVE%\Sites MD %HOMEDRIVE%\Sites

REM
REM Set the HOME environment variables for Ruby & Gems to use with ENV["HOME"]
REM
SET HOME=%HOMEDRIVE%%HOMEPATH%

SET RailsInstallerPath=%1
REM Check configurations for Git and SSH
IF EXIST %RailsInstallerPath% (
  ruby %RailsInstallerPath%\scripts\config_check.rb
) ELSE (
  ruby.exe "require 'rbconfig' ; file=%%\#{RbConfig::}"
)

REM NOTE that we start out in the Sites directory as the current working dir
IF EXIST %HOMEDRIVE%\Sites CD %HOMEDRIVE%\Sites

However, I don't have 1.9.1 installed and I'm not sure what the heck this .bat file is doing.

I'm going to hop on another computer and see what installing 1.1.0 on there does.

@coderjoe
Copy link
Contributor

@Insood thank you for your prompt follow-up! Now that I can reproduce the specific library load error you showed in your screenshot above I'll move forward with debugging. If you find anything else interesting please continue to let us know. :)

@coderjoe
Copy link
Contributor

coderjoe commented Jan 21, 2017

@Insood can you do me a favor and test one of these gemfiles in place of the tiny_tds gem hosted on rubygems based on your platform?

https://drive.google.com/open?id=0BxSqGuxD46a2ZjlkTzFleXFmUVkx

Please try the x64 build in your environment and get back to me. I'm running into something rather odd and I want to confirm you still have problems.

@metaskills The oddity I'm running into is that the gem files I build locally don't have the errant requirement listed in the screenshots above, but the gems hosted on rubygems.org do. They should both be built from the exact same source so I'm very confused as to what could possibly be causing the difference.

@metaskills
Copy link
Member

@coderjoe Do you want to try and build and push new v1.1.1 gems to rubygems? I can add you to the rubygems if you give me your email for there.

@coderjoe
Copy link
Contributor

coderjoe commented Jan 22, 2017

@metaskills Not quite ready to release anything yet. I haven't proven I can fix anything, and I've no interest in pushing a patch that doesn't do anything. ;)

I'll e-mail you from my e-mail address anyway. If we get to the point that we have confirmation that they work I can push a patch with gems built on my machine.

@Donato10
Copy link

I have the same issue. Now I have uninstall the previous version of tiny_tds (x86) and installed the one suggested by @coderjoe (x64) allocated on google drive. The message is now:
LoadError: cannot load such file -- tiny_tds
I'm new on ruby on rails, so my knowledge is not very deep, however I hope this helps!
Thanks

@cmendla
Copy link

cmendla commented Jan 27, 2017

FWIW - I ran into a similar issue while working on a project in development. I ran bundle update and started getting Tiny TDs errors. I changed to gemfile to read gem 'tiny_tds', '~> 1.0.5' and ran bundle install a couple of times. It seems to be working for now (I have to move on to other areas of the development so I was mostly interested in just getting things working again. )

I am seeing warnings after running bundle install of

C:\Users\cmendla\RubymineProjects\slitter_bedsheets\bin\rails
Warning:Get available generators script executes with errors:
Warning:Expected string default value for '--jbuilder'; got true (boolean)
Warning:Expected string default value for '--rc'; got false (boolean)
Warning:Expected string default value for '--helper'; got true (boolean)
Warning:Expected string default value for '--assets'; got true (boolean)
Warning:Expected string default value for '--rc'; got false (boolean)

but things appear to be working and I'm not totally sure that is related to tiny tds.


Notes

  1. I am running on windows 7 64 bit
  2. I have about a half dozen apps in production using Tiny_tds on a window IIS server and have not had problems.
  3. The problems started when I ran bundle update. I think the Tiny TDS version went to 1.1.0.
  4. I am a bit fuzzy on how FreeTds works and havent' looked at that in detail.
  5. I am running Rubymine (Not sure about 32/64 though). I'm not sure how to check if I have the development kit installed.
  6. when I ran bundle update, I did it through rubymine.

@metaskills
Copy link
Member

Thanks! Those warnings are from Rails. I think you did a bundle update in mass vs a bundle update tiny_tds and moved a few other gems forward, hence the changes/warnings. The other info is helpful. Appreciate it.

@fpauser
Copy link

fpauser commented Jan 30, 2017

Same issue here with ruby 2.2.6p396 (2016-11-15 revision 56800) [i386-mingw32] on a Windows 2012 Server.

Downgrading from tiny_tds-1.1.0-x86-mingw32.gem to tiny_tds-1.0.5-x86-mingw32.gem helped.

@CCH4GITHUB
Copy link

Windows 8 pro
installed via railsinstaller-3.2.1.exe.

metaskills pushed a commit that referenced this issue Mar 12, 2017
* Use OpenSSL v1.1.0e & FreeTDS v1.00.27 for Windows builds.
* Adapt dll names to 1.1.0 scheme
 - libeay -> libcrypto
 - ssleay -> libssl
* Use perl in Git installation for openssl
* OpenSSL Requires Perl >= 5.10, while the Ruby devkit uses MSYS1 with Perl 5.8.8. To overcome this, prepend Git's usr/bin to the PATH. It has MSYS2 with a recent version of perl.
* MinGW: Fix inet_pton also for 32-bit
@metaskills
Copy link
Member

Pull Request #347 pulled in OpenSSL v1.1.0 and we got new versions of TinyTDS at v1.2.0 which should solve this issue. Please reply back and let us know.

@Insood
Copy link

Insood commented Mar 14, 2017

Hate to be the bearer of bad news, but still the same issue with 1.2.0. Created a brand new project, included 1.2.0 and got the following:

X:\insood\Documents\Projects\NewPartsCache>rails s
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/tiny_tds-1.2.0-x86-mingw32/lib/tiny_tds.rb:22:in `require': cannot
load such file -- tiny_tds/tiny_tds (LoadError)
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/tiny_tds-1.2.0-x86-mingw32/lib/tiny_tds.rb:22:in `resc
ue in <top (required)>'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/tiny_tds-1.2.0-x86-mingw32/lib/tiny_tds.rb:25:in `<top
 (required)>'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `require'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:91:in `block (2
levels) in require'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `each'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:86:in `block in
require'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `each'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/runtime.rb:75:in `require'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler.rb:106:in `require'
        from X:/gpopov/Documents/Projects/NewPartsCache/config/application.rb:17:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:88
:in `require'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:88
:in `block in server'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85
:in `tap'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85
:in `server'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49
:in `run_command!'
        from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (requ
ired)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

@orgads
Copy link
Contributor

orgads commented Mar 15, 2017

libsybdb-5.dll depends on libgcc_s_sjlj-1.dll which is not installed by default.

Maybe we should use -static-libgcc for freetds?

@onthespotqa
Copy link

I have an engineer on my team who installed the gems for a project yesterday. when they ran the project they got this issue. I had this issue for a couple days, and fixed it through futzing with something on my machine. I can't remember what i did to fix it.

Is there an update that was supposed to fix this?

@metaskills
Copy link
Member

Yes, v1.3.0 was that fix.

@IBSLPUNE
Copy link

IBSLPUNE commented Mar 6, 2018

C:\Sites\hrms>rails c
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:46:in require': cannot load such file -- tiny_tds/tiny_tds (LoadError) from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:46:in rescue in
block in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:43:in block in <top (required)>' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:37:in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:37:in block in <top (required)>' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:34:in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:34:in block (2 levels) in <top (required)>' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:24:in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:24:in rescue in block in <top (required)>' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:17:in block in
<top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:33:in call' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:33:in block in
<top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:34:in call' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:34:in block (2
levels) in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:24:in call' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:24:in rescue in
block in <top (required)>'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:17:in block in <top (required)>' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:33:in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:33:in block in <top (required)>' from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:34:in call'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-2.1.1-x86-mingw32/lib/tiny_tds.rb:34:in `block (2
levels) in <top (required)>'

@PhilipJordan
Copy link

So I have also run into this issue on an old project we have (but I found a solution). My environment was:

Ruby: ruby 2.3.3p222 (used railsinstaller.org to install ruby)
Gems: tiny_tds (2.0.0 x86-mingw32) and activerecord-sqlserver-adapter (5.1.6) (primary reason for dependency)

I tried all of the steps mentioned above with no joy (was still getting the same error on the same ActiveRecord call). This included installing the tiny_tds older gem version so my new gem list looked like this:
tiny_tds (2.0.0 x86-mingw32, 1.3.0 x86-mingw32, 1.0.5 x86-mingw32)

From here I uninstalled 2.0.0 x86-mingw32 version of the gem. Now everything I know about the way that the gem manager handles gems had me convinced this wouldn't have any effect but it seems to have solved the issue (clearly there are still many things I do not know). No other changes were introduced between when I ran with 2.0/1.3/1.0 installed and when I uninstalled to only have 1.3/1.0

@viniciusgati
Copy link

Upgrading to 1.2 solved to me, windows 10 64b rails installer ruby 2.3

@ruehsn
Copy link

ruehsn commented Feb 22, 2019

Downgrading from Version 2.1.2 to Version 1.3 worked for me

@wvkmind
Copy link

wvkmind commented Jul 2, 2019

Downgrading from Version 2.1.2 to Version 1.3 worked for me

Downgrading from Version 2.1.2 to Version 1.3 worked for me +1

windows server 2007 service pack 2

aharpervc pushed a commit to aharpervc/tiny_tds that referenced this issue Apr 9, 2020
…qlserver#310 rails-sqlserver#290 rails-sqlserver#349 rails-sqlserver#323 rails-sqlserver#330

* Use OpenSSL v1.1.0e & FreeTDS v1.00.27 for Windows builds.
* Adapt dll names to 1.1.0 scheme
 - libeay -> libcrypto
 - ssleay -> libssl
* Use perl in Git installation for openssl
* OpenSSL Requires Perl >= 5.10, while the Ruby devkit uses MSYS1 with Perl 5.8.8. To overcome this, prepend Git's usr/bin to the PATH. It has MSYS2 with a recent version of perl.
* MinGW: Fix inet_pton also for 32-bit
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