我下载了 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 中止!请安装 sqlserver 适配器:(
gem install activerecord-sqlserver-adapte r
没有要加载的文件 -- active_record/connection_adapters/sqlserver_adapter)org/jruby/RubyKernel.java:1033:in
require' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/dependencies.rb:251:in
需要'F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/dependencies.rb:236:在load_dependency' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/activesupport-3 .2.1/lib/active_support/dependencies.rb:251:in
需要'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:4 8:inresolve_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:in
resolve_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:in
建立连接'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:in
instance_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:inexecute_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:in
run_load_hooks' org/jruby/RubyArray.java: 1615:在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:in
run_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:incall' 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:inexecute' org/jruby/RubyArray.java:1615:in
each' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib /rake/task.rb:200:inexecute' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/task.rb:158:in
invoke_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:in
invoke_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:ininvoke_prerequisites' org/jruby/RubyArray.java:1615:in
each' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:ininvoke_prerequisites' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/task.rb:157:in
invoke_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:in
invoke_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:ininvoke' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/application.rb:116:in
invoke_task ' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level' org/jruby/RubyArray.java:1615:in
each' 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:in
standard_exception_handling' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/li b/rake/application.rb:66:in
run' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_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:in
run' F:/Program Files/BitNami JRubyStack/jruby/lib/ruby/gems /1.8/gems/rake-0.9.2.2/bi n/rake:33:in(root)' org/jruby/RubyKernel.java:1058:in
load' F:/Program Files/BitNami JRubyStack/jruby/bin/rake:23:in `(root)' 任务:TOP => db :migrate => db:load_config