rake db:使用tiny_tds和sqlserver适配器迁移时出错 [英] Error with rake db:migrate using tiny_tds and sqlserver adapter
问题描述
当我尝试使用rake db:migrate
时,出现此错误:
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)
这是我的database.yml文件:
#
# 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
有人可以帮忙吗?我似乎找不到解决方案,基本上已经在网上看到了所有地方,也找不到针对此特定情况的适当解决方案,我尝试了卸载和重新安装,并且两个gem都在gemfile上声明了. >
我最近遇到了这个问题,事实证明,该问题是由于Ruby DevKit没有包含在我的Windows系统和用户PATH变量中引起的. /p>
我的完整答案/解决方案可以在其他与此相关的Stack Overflow帖子中找到: https://stackoverflow.com/a/51488484 /1546785
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
这篇关于rake db:使用tiny_tds和sqlserver适配器迁移时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!