rake db:schema:dump NoMethodError:undefined method`info_schema_query'

时间:2014-12-17 05:39:35

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

我正在尝试从Ruby on Rails应用程序连接到SQL Server 2012数据库。运行rake命令时出现此错误。我每次安装新宝石时都应该运行命令bundle install吗?我不确定为什么我收到NoMethodError: undefined...

以下的错误
 rake db:schema:dump RAILS_ENV=development
    rake aborted!
    NoMethodError: undefined method `info_schema_query' for #<ActiveRecord::ConnectionAdapters::SQLServerAdapter:0x007fba899762b0>

    Tasks: TOP => db:schema:dump

这是我的database.yml文件

    default: &default
      adapter: sqlserver
      encoding: utf8
      port: 1433
      pool: 5
      username: myuser
      password: secretpassword
      socket: /tmp/mysql.sock
      host: 184.168.194.51

    development:
      <<: *default
      database: mydbname


    test:
      <<: *default
      database: mydbname


    production:
      <<: *default
      database: simple_cms_production
      username: simple_cms
      password: <%= ENV['SIMPLE_CMS_DATABASE_PASSWORD'] %>

这是我的Gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use mysql as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development

gem 'tiny_tds', '~> 0.6.2'

gem 'sql_server', '~> 0.1.1'

gem 'activerecord-sqlserver-adapter', '~> 4.1.0'

gem 'activerecord-sqlserver-adapter-schemas', '~> 1.0.2'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

0 个答案:

没有答案