Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

Ruby 3.0 / Rails 6 connection to SQL Server via ODBC?

What is the best way to connect to MS SQL Server from Rails 6? I'm trying to port a rails app that has been developed with a SQLite backend onto Azure, where the preference is to use the Azure SQL database.

For testing I have an MS SQL Server Docker image running locally. After a bit of fiddling, I have the ActiveRecord sqlserver_adapter correctly loading - but I'm having problems with the ruby rails-odbc driver. It's specified in my Gemfile:

gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter'
gem 'rails-odbc'

But when I run bundle install I get the following error:

steve@AMEYLT722355L:~/git/risk_front$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Could not find gem 'rails-odbc x86_64-linux' in any of the gem sources listed in your Gemfile.

Anyone know how to find this version of the rails-odbc driver, or alternately another way of connecting to MS SQL Server from Rails 6.

Thanks

Steve

question from:https://stackoverflow.com/questions/65902625/ruby-3-0-rails-6-connection-to-sql-server-via-odbc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...