在 Rails 应用程序或控制台中针对带有 tiny_tds 的 SQL Server 运行查询时出现错误。注意:gem install tiny_tds
成功了。
未定义符号:rb_thread_blocking_region
../bin/ruby: symbol lookup error:
/var/www/.../tiny_tds-0.6.2/lib/tiny_tds/tiny_tds.so:
undefined symbol: rb_thread_blocking_region
我的系统设置:
- Centos 7.0
- 红宝石 2.2.0p0
- 导轨 4.1.4
安装了 freetds 和 freetds-devel:
Version: freetds v0.91
freetds.conf directory: /etc
MS db-lib source compatibility: yes
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes
我的 MSSQL 部分config/database.yml
看起来像(我正在连接到远程主机):
devel_sql:
adapter: sqlserver
mode: dblib
dataserver: DBSERVER\DBINSTANCE
encoding: utf8
database: SOMEDATABASENAME
username: xxxx
password: yyyy
reconnect: true
autocommit: true
timeout: 5000
我的宝石文件:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# 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'
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
# 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]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'pg'
# MSSQL gems
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
该查询在 Centos 6.3 上运行。可能有任何版本冲突吗?