由于我在Windows笔记本电脑上使用的工具都不能从SQL Server中导出合适的CSV文件来挽救他们的生命,我想我会在几行Ruby中自行编写。
因为我从世纪之交到达了SQL Server的版本,所以我必须使用旧版本的activerecord-sqlserver-adapter。据我所知,我正确地这样做,并且应该使用activerecord ~> 2.2.3
和activerecord-sqlserver-adapter的2-3-stable
分支,但是我收到的错误是抱怨它是{{ 1}}。这是我的代码(没有任何与CSV特别相关的内容):
Unable to activate activerecord-sqlserver-adapter-3.2.12, because activerecord-2.2.3 conflicts with activerecord (~> 3.2.0)
为什么首先尝试加载#!/usr/bin/env ruby
gem 'activerecord', "~> 2.2.3"
gem 'activerecord-sqlserver-adapter', github: 'arthrex/activerecord-sqlserver-adapter', :branch => '2-3-stable'
require 'activerecord'
require 'activerecord-sqlserver-adapter'
require 'pry'
ActiveRecord::Base.establish_connection(
:adapter => "sqlserver",
:mode => "odbc",
:username => "c3",
:password => "92641",
:dsn => "Connect3"
)
ActiveRecord::Base.table_name_prefix = 'dbo.'
class Dwnld_Hdr < ActiveRecord::Base
end
pry
?