Ruby on rails RubyonRails在Database.yml中设置到远程数据库的MS SQL连接
我想将我的Ruby On Rails应用程序(用Ruby mine开发)与运行在外部PC上的MS SQL Server 2008 R2连接起来 我可以通过以下方式与运行Ruby mine的同一台PC上运行的Microsoft SQL Server Management Studio连接到远程数据库:Ruby on rails RubyonRails在Database.yml中设置到远程数据库的MS SQL连接,ruby-on-rails,sql-server,rubymine,Ruby On Rails,Sql Server,Rubymine,我想将我的Ruby On Rails应用程序(用Ruby mine开发)与运行在外部PC上的MS SQL Server 2008 R2连接起来 我可以通过以下方式与运行Ruby mine的同一台PC上运行的Microsoft SQL Server Management Studio连接到远程数据库: Server name is: domain.de,PORT\SQLServerName 然后我连接到此远程数据库: 在rubymine中,我使用宝石: 现在我可以在database.yml
Server name is: domain.de,PORT\SQLServerName
然后我连接到此远程数据库:
在rubymine中,我使用宝石:
现在我可以在database.yml
中使用adapter:sqlserver
,没有错误
但我不知道如何连接到远程数据库:
我厌倦了几个示例配置,如:
当我在开发模式下运行应用程序时,出现以下错误:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/tiny_tds-0.6.1-x86-mingw32/lib/tiny_tds/client.rb:77:in `connect': Server name not found in configuration files (TinyTds::Error)
有谁能帮我了解一下数据库.yml
的语法,它可以使用输入数据I
还用于与MS SQL Server Management Studio连接到远程数据库我自己修复了它:
用双点替换逗号
dataserver: 'domain.de:50021\xxxxxxSQLServer'
该死的WINDOWS我想知道数据库服务器是否是“domain.de:50021\\xxxxxx sqlserver”。注意这里的“\\”而不是“\\”。是的,是关于端口号的。