我下载了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产品名称: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: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 /抽象/ 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:in
resolve_string_connection'F:/ Program Files / BitNami中 JRubyStack / jruby的/ LIB /红宝石/宝石/ 1.8 /宝石/了activerecord-3。 2.1 / LIB / active_record / connection_adapters /抽象/ 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
establish_connection'F:/ Program Files / BitNami中 JRubyStack / jruby的/ LIB /红宝石/宝石/ 1.8 /宝石/了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:ineach' 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 /红宝石/宝石/ 1.8 /宝石/了activerecord-3。 2.1 / lib / active_record / base.rb:716:在(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:在call' org/jruby/RubyProc.java:220:in
中调用'F:/ Program Files / BitNami JRubyStack / JRuby的/ lib目录/红宝石/宝石/ 1.8 /宝石/耙-0.9.2.2 /李 b / rake / task.rb:205:在execute' org/jruby/RubyArray.java:1615:in
每个'F:/ Program Files / BitNami中 JRubyStack / JRuby的/ lib目录/红宝石/宝石/ 1.8 /宝石/耙-0.9.2.2 /李 b / 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 文件/ BitNami JRubyStack / jruby / lib / ruby / gems / 1.8 / gems / rake-0.9.2.2 / li b / rake / task.rb:176:invoke_prerequisites' org/jruby/RubyArray.java:1615:in
每个'F:/ Program Files / BitNami JRubyStack / JRuby的/ lib目录/红宝石/宝石/ 1.8 /宝石/耙-0.9.2.2 /李 b / rake / task.rb:174:在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: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 文件/ BitNami JRubyStack / jruby / lib / ruby / gems / 1.8 / gems / rake-0.9.2.2 / li b / rake / task.rb:144:在invoke' 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目录/红宝石/宝石/ 1.8 /宝石/耙-0.9.2.2 /李 b / rake / application.rb:94:top_level' org/jruby/RubyArray.java:1615:in
每个'F:/ Program Files / BitNami JRubyStack / JRuby的/ lib目录/红宝石/宝石/ 1.8 /宝石/耙-0.9.2.2 /李 b / 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 文件/ BitNami JRubyStack / jruby / lib / ruby / gems / 1.8 / gems / rake-0.9.2.2 / li b / rake / application.rb:88:在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:in
运行'F:/ Program Files / BitNami JRubyStack / JRuby的/ lib目录/红宝石/宝石/ 1.8 /宝石/耙-0.9.2.2 /李 b / rake / application.rb:133:在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:in
运行'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
加载'F:/程序 Files / BitNami JRubyStack / jruby / bin / rake:23:in`(root)'Tasks:TOP => db:migrate =>分贝:load_config
答案 0 :(得分:1)
确保将以下行添加到Gemfile
gem 'activerecord-sqlserver-adapter'