Reputation: 1
I have written a Ruby on Rails app on Windows 10 that uses SQLite3
in development but needs to use SQLServer
in production. I am using Ruby 2.3.3 and Rails 5.1.4.
I included the tiny_tds
and activerecord-sqlserver-adapter
gems in the Gemfile
and ran 'bundle install'
. This seems to have completed successfully. I then ran 'rails db:migrate RAILS_ENV=production'
and got the error 'LoadError: cannot load such file -- tiny_tds/tiny_tds'
.
The complete error message output is below. Can you please tell me what the problem may be and what I can do to fix it.
$ rails db:migrate RAILS_ENV=production
rails aborted!
LoadError: cannot load such file -- tiny_tds/tiny_tds
c:/Sites/turkeytote/config/application.rb:7:in <top (required)>' c:/Sites/turkeytote/Rakefile:4:inrequire_relative'
c:/Sites/turkeytote/Rakefile:4:in <top (required)>' bin/rails:4:inrequire'
bin/rails:4:in `
'
LoadError: 126: The specified module could not be found. - c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/tiny_tds-2.1.0-x86-mingw32/lib/tiny_tds/2.3/tiny_tds.so
Upvotes: 0
Views: 952
Reputation: 3566
I ran into this problem recently, and it turns out that the issue was due to the Ruby DevKit not being included in my Windows system and user PATH variables.
I was using the Windows Ruby 2.3 Rails Installer from http://railsinstaller.org/en, which installs Ruby (and related libraries) at the C:\RailsInstaller location by default.
If you open a command prompt and browse to C:\RailsInstaller\DevKit, then run the "devkitvars.bat" file, this will add the relevant paths to your PATH variable: C:\RailsInstaller\DevKit\bin;C:\RailsInstaller\DevKit\mingw\bin;
After doing this, tiny_tds worked, and my rails db:migrate
command finally worked successfully.
Note: This is not a permanent fix. To fix the issue permanently, you need to actually edit your Windows PATH settings.
Setting your PATH (on Windows 10 and Windows 8)
path
to make sure that your changes are in effect.Upvotes: 1