rake db出错:使用tiny_tds和sqlserver adapter

时间:2017-05-23 14:44:17

标签: sql ruby-on-rails sql-server ruby rubygems

当我尝试使用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

有人可以帮忙吗?我似乎无法找到解决方案,我在网络上的任何地方基本上都看不到,并且无法找到适合此特定情况的解决方案,我已尝试卸载并重新安装,两者都是宝石在gemfile上声明。

1 个答案:

答案 0 :(得分:0)

我最近遇到了这个问题,事实证明,这个问题是由于Ruby DevKit没有包含在我的Windows系统和用户PATH变量中造成的。

我的完整答案/解决方案可以在其他相关的Stack Overflow帖子中找到:https://stackoverflow.com/a/51488484/1546785