2

BitNami の Jruby をダウンロードしました。すべて問題ありませんが、SQL Server 2008 に接続しようとすると、何か問題が発生します。

database.yml は次のとおりです。

development:
       adapter: sqlserver
      host: 127.0.0.1
      instanceName: SQLServer2008
      database: truetemp
      username: sa
      password: 7354500

コマンド「Jruby -S rails generate scaffold Product title:string ....」を使用すると、ROR がうまく機能します。しかし、コマンド「rake db:migrate --trace」は失敗します。

f:\tmp\RubyMine201207>rake db:migrate --trace ** db:migrate を呼び出します (first_time) ** 環境を呼び出します (first_time) ** 環境を実行します ** db:load_config を呼び出します (first_time) ** rails_env を呼び出します (first_time) ** rails_env を実行 ** db:load_config を実行 rake aborted! sqlserver アダプターをインストールしてください: gem install activerecord-sqlserver-adapte r(ロードするファイルはありません -- active_record/connection_adapters/sqlserver_adapter)

org/jruby/RubyKernel.java:1033: require' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/dependencies.rb:251:inrequire' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236: require' F:/Program Files/ BitNami load_dependency' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/dependencies.rb:251:inJRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:4 8: resolve_hash_connection' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:3 9:inresolve_string_connection' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:2 3: spec' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:1 27:inenstitute_connection' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/railtie.rb:76:inRailtie' org/jruby/RubyKernel.java:2045:ininstance_eval' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/lazy_load_hooks.rb:36:in execute_hook' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/lazy_load_hooks.rb:43:inrun_load_hooks' org/jruby/RubyArray.java: 1615: in each' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/lazy_load_hooks.rb:42:inrun_load_hooks' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/base.rb:716:in (root)' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activerecord-3. 2.1/lib/active_record/base.rb:6:in(root)' org/jruby/RubyProc.java:270:in call' org/jruby/RubyProc.java:220:in call' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems /rake-0.9.2.2/lib/rake/task.rb:205:in execute' org/jruby/RubyArray.java:1615:in each' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b /rake/task.rb:200:in execute' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/task.rb:158:ininvoke_with_call_chain' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/1.8/monitor.rb:191:inmon_sy nchronize' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/task.rb:151:ininvoke_with_call_chain' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in invoke_prerequisites' org/jruby/RubyArray.java:1615:ineach' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in invoke_prerequisites' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/task.rb:157:ininvoke_with_call_chain' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/1.8 /monitor.rb:191:in mon_sy nchronize' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/task.rb:151:ininvoke_with_call_chain' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in invoke' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/application.rb:116:ininvoke_task ' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in top_level' org/jruby/RubyArray.java:1615:ineach' F:/Program Files/BitNami JRubyStack /jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/application.rb:133:instandard_exception_handling' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/application.rb:66:inrun' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/application.rb:63:inrun' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems /1.8/gems/rake-0.9.2.2/bin/rake:33:in (root)' org/jruby/RubyKernel.java:1058:inload' F:/Program Files/BitNami JRubyStack/jruby/bin/rake:23:in `(root)' Tasks: TOP => db :migrate => db:load_config

4

1 に答える 1

1

必ず次の行をGemfile

gem 'activerecord-sqlserver-adapter'

于 2012-07-14T07:29:39.277 に答える