简体   繁体   中英

Error with rake db:migrate using tiny_tds and sqlserver adapter

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM