Error with rake db:migrate using tiny_tds and sqlserver adapter

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 08:23:12

问题


When I try using rake db:migrate I get this error:

LoadError: cannot load such file -- tiny_tds/tiny_tds
D:/myrailsapp/config/application.rb:7:in `<top (required)>'
D:/myrailsapp/Rakefile:4:in `require_relative'
D:/myrailsapp/Rakefile:4:in `<top (required)>'
LoadError: 126: The specified module could not be found.   - D:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/tiny_tds-1.1.0-x86-mingw32/lib/tiny_tds/2.2/tiny_tds.so
D:/myrailsapp/config/application.rb:7:in `<top (required)>'
D:/myrailsapp/Rakefile:4:in `require_relative'
D:/myrailsapp/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

This is my database.yml file:

#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  adapter: sqlserver
  mode: odbc
  dsn: railsapp
  database: sqlserverapp

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
  database: db/production.sqlite3

Can somebody help? I can't seem to find a solution, I've looked basically everywhere on the web and can't find a proper solution to this specific case, I've tried uninstalling and reinstalling, and both gems are declared on gemfile.


回答1:


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.

My full answer/solution can be found on this other related Stack Overflow post: https://stackoverflow.com/a/51488484/1546785



来源:https://stackoverflow.com/questions/44138013/error-with-rake-dbmigrate-using-tiny-tds-and-sqlserver-adapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!