Я пытаюсь подключиться к серверу SQL под названием Demand, используя этот гем:
https://github.com/rails-sqlserver/I'm
Я следую рецепту №3 из книги «Рельсовые рецепты» http://pragprog.com/book/rr2/rails-recipes
Вот мой файл database.yml:
demand:
adapter: sqlserver
host: 172.21.148.01
port: 1433
database: Demand
username: DEapp
password: @pp1user
timeout: 5000
Из консоли rails, когда я проверяю соединение с Demand.connection
, я получаю следующее:
(Я знаю, что addy и pw хороши, так как я сейчас подключен через жабу, также создал модель 'Demand', чтобы у рельсов был объект)
> TinyTds::Error: Login failed for user ‘DEapp’. from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/tiny_tds-0.5.1/lib/tiny_tds/client.rb:68:in
> `connect’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/tiny_tds-0.5.1/lib/tiny_tds/client.rb:68:in
> `initialize’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-sqlserver-adapter-3.1.6/lib/active_record/connection_adapters/sqlserver_adapter.rb:400:in
> `new’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-sqlserver-adapter-3.1.6/lib/active_record/connection_adapters/sqlserver_adapter.rb:400:in
> `connect’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-sqlserver-adapter-3.1.6/lib/active_record/connection_adapters/sqlserver_adapter.rb:198:in
> `initialize’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-sqlserver-adapter-3.1.6/lib/active_record/connection_adapters/sqlserver_adapter.rb:35:in `new’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-sqlserver-adapter-3.1.6/lib/active_record/connection_adapters/sqlserver_adapter.rb:35:in `sqlserver_connection’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:304:in
> `new_connection’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:323:in
> `checkout_new_connection’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in
> `block (2 levels) in checkout’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in
> `loop’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in
> `block in checkout’ from
> /Users/drewgilliam/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in
> `mon_synchronize’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:260:in
> `checkout’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:162:in
> `connection’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in
> `retrieve_connection’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in
> `retrieve_connection’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection’ from (irb):11 from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands/console.rb:45:in
> `start’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands/console.rb:8:in
> `start’ from
> /Users/drewgilliam/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands.rb:40:in
> `‘ from script/rails:6:in `require’
Любая помощь? Вот форум Pragmatic Programmer, если вы тоже хотите ответить: http://forums.pragprog.com/forums/189/topics/10476