2012-05-04 17 views
0

ODBC接続を行わずにSQL Serverに接続しました。私はform.NETに来ているので、セキュリティを統合した接続文字列のようなものを探しています。RubyとSQLサーバー

ここで接続設定が間違っているかどうかわかりません。助けてください!

development: 
adapter: sqlserver 
    database: odbc 
    dsn: Driver={SQL Native Client};Server=.;Database=RubyDemo;Trusted_Connection=yes; 
    pool: 5 
    timeout: 5000 
test: 
    adapter: sqlserver 
    database: odbc 
    dsn: Driver={SQL Native Client};Server=.;Database=RubyDemo;Trusted_Connection=yes; 
     pool: 5 
    timeout: 5000 

     production: 
     adapter: sqlserver 
      database: odbc 
     dsn: Driver={SQL Native Client};Server=.;Database=RubyDemo; Trusted_Connection=yes; 
pool: 5 
     timeout: 5000 



** Invoke db:migrate (first_time) 
** Invoke environment (first_time) 
** Execute environment 
** Invoke db:load_config (first_time) 
** Invoke rails_env (first_time) 
    ** Execute rails_env 
    ** Execute db:load_config 
rake aborted! 
couldn't parse YAML at line 21 column 12 
c:/Ruby192/lib/ruby/1.9.1/psych.rb:148:in `parse' 
c:/Ruby192/lib/ruby/1.9.1/psych.rb:148:in `parse_stream' 
c:/Ruby192/lib/ruby/1.9.1/psych.rb:119:in `parse' 
c:/Ruby192/lib/ruby/1.9.1/psych.rb:106:in `load' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application /configuration.rb:115:in `database_configuration' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record /railtie.rb:75:in `block (2 levels) in <class:Railtie>' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/base.rb:721:in `<top (required)>' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/railties/databases.rake:6:in `block (2 levels) in <top (required)>' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' 
     c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
     c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites' 
     c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain' 
    c:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
     c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
    c:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>' 
    c:/Ruby192/bin/rake:19:in `load' 
    c:/Ruby192/bin/rake:19:in `<main>' 
    Tasks: TOP => db:migrate => db:load_config 

enter image description here

+1

データベースに接続しようとする前に、YAML構文解析の問題/構文エラーのように見えます。 YAMLファイルの字下げは実際に正しいですか? YAMLの残りの部分はどこですか?その抜粋に21行はありませんか? –

+0

イメージを更新します。今21行目を見ることができます – Gainster

答えて

2

あなたはYAMLでのインデントの問題を抱えています。 productionは、test以上インデントしないでください。