我们正在试图让轨道交谈在Azure上一个SQLServer数据库,我们安装与OpenSSL和libiconv的freetds的:
./configure --prefix=/usr/local --with-libiconv-prefix=DIR --with-openssl=DIR
make
make install
然后,我们添加tiny_TDS和ActiveRecord的 - SQLSERVER适配器到的Gemfile:
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
$ bundle install
配置数据库:
development:
adapter: sqlserver
host: xxxxxxx.database.windows.net
mode: DBLIB
port: 1433
database: xxxxx
username: xxxxxxxx
password: x
azure: true
运行服务器:
$ rails s
一切都很正常,直到这一点,但只要您亲临现场红宝石崩溃。
steven@jenny:~/irr$ rails server -p 3001
=> Booting WEBrick
=> Rails 3.0.4 application starting in development on http://0.0.0.0:3001
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-07-24 15:37:00] INFO WEBrick 1.3.1
[2012-07-24 15:37:00] INFO ruby 1.9.2 (2012-02-14) [x86_64-linux]
[2012-07-24 15:37:00] INFO WEBrick::HTTPServer#start: pid=7586 port=3001
/home/steven/.rvm/gems/ruby-1.9.2-p318/gems/tiny_tds-0.5.1/lib/tiny_tds/client.rb:68: [BUG] Segmentation fault
ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-linux]
-- control frame ----------
c:0048 p:---- s:0232 b:0232 l:000231 d:000231 CFUNC :connect
c:0047 p:0429 s:0228 b:0228 l:000227 d:000227 METHOD /home/steven/.rvm/gems/ruby-1.9.2-p318/gems/tiny_tds-0.5.1/lib/tiny_tds/client.rb:68
我们试过红宝石的几个版本:1.9.2-P318,1.9.2-P320,1.9.3-P125。 同样的错误与他们的。
这是使用RVM和freetds的-0.9.1的Ubuntu 11.10。
在解决方法什么想法吗?
有我的地方,一路上犯了一个错误?
编辑
从IRB输出:
require 'tiny_tds'
client = TinyTds::Client.new(:username =>'XXXXX@XXXXXXX.database.windows.net', :password => 'XXXXXXX', :host => 'XXXXXX.database.windows.net', :mode => 'DBLIB', :azure => 'true')
SystemStackError: stack level too deep from /home/martinr/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/irb/workspace.rb:80
Maybe IRB bug!!
这似乎是红宝石本身就是一个错误:
/home/martinr/.rvm/gems/ruby-1.9.2-p320/gems/tiny_tds-0.5.1/lib/tiny_tds/client.rb:68: [BUG] Segmentation fault (core dumped)