1

使用 rails 3.2 应用程序,我一直在尝试在 jruby 中运行数据库迁移。我使用命令:

jruby --1.9 -S rake db:migrate --trace

这是输出:

jruby --1.9 -S rake db:migrate --trace
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/version.rb:2 warning: already initialized constant VERSION
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/version.rb:5 warning: already initialized constant MAJOR
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/version.rb:5 warning: already initialized constant MINOR
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/version.rb:5 warning: already initialized constant BUILD
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/version.rb:5 warning: already initialized constant PATCH
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/version.rb:6 warning: already initialized constant NUMBERS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake.rb:27 warning: already initialized constant RAKEVERSION
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/early_time.rb:17 warning: already initialized constant EARLY
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/alt_system.rb:32 warning: already initialized constant WINDOWS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/application.rb:31 warning: already initialized constant DEFAULT_RAKEFILES
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task_arguments.rb:77 warning: already initialized constant EMPTY_TASK_ARGS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/invocation_chain.rb:49 warning: already initialized constant EMPTY
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:9 warning: already initialized constant RUBY
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:86 warning: already initialized constant LN_SUPPORTED
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:16 warning: already initialized constant DEFAULT
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/dsl_definition.rb:150 warning: already initialized constant DeprecatedCommands
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:44 warning: already initialized constant ARRAY_METHODS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:47 warning: already initialized constant MUST_DEFINE
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:51 warning: already initialized constant MUST_NOT_DEFINE
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:55 warning: already initialized constant SPECIAL_RETURN
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:61 warning: already initialized constant DELEGATING_METHODS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:364 warning: already initialized constant DEFAULT_IGNORE_PATTERNS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/file_list.rb:370 warning: already initialized constant DEFAULT_IGNORE_PROCS
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake.rb:68 warning: already initialized constant FileList
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake.rb:69 warning: already initialized constant RakeFileUtils
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
stack level too deep
org/jruby/RubyProc.java:258:in `call'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/activesupport-3.2.0/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/activesupport-3.2.0/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
org/jruby/RubyArray.java:1615:in `each'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/activesupport-3.2.0/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/application/finisher.rb:60:in `Finisher'
org/jruby/RubyBasicObject.java:1757:in `instance_exec'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `run_initializers'
org/jruby/RubyArray.java:1615:in `each'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
org/jruby/RubyBasicObject.java:1698:in `__send__'
org/jruby/RubyKernel.java:2097:in `send'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/aaronmcleod/Documents/rails/rails3inaction/ticketee/config/environment.rb:5:in `(root)'
org/jruby/RubyKernel.java:1042:in `require'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
/Users/aaronmcleod/Documents/rails/rails3inaction/ticketee/config/environment.rb:103:in `require_environment!'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/railties-3.2.0/lib/rails/application.rb:292:in `initialize_tasks'
org/jruby/RubyProc.java:258:in `call'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
org/jruby/RubyArray.java:1615:in `each'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/aaronmcleod/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/monitor.rb:201:in `mon_synchronize'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
org/jruby/RubyArray.java:1615:in `each'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/Users/aaronmcleod/.rvm/rubies/jruby-1.6.7/lib/ruby/1.9/monitor.rb:201:in `mon_synchronize'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
org/jruby/RubyArray.java:1615:in `each'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/aaronmcleod/.rvm/gems/jruby-1.6.7/gems/rake-0.9.2.2/bin/rake:33:in `(root)'
org/jruby/RubyKernel.java:1068:in `load'
/Users/aaronmcleod/.rvm/rubies/jruby-1.6.7/bin/rake:19:in `(root)'
Tasks: TOP => db:migrate => environment

我能跑得jruby --1.9 -S rake db:create很好。

4

1 回答 1

1

bundle exec rake db:migrate

代替

rake db:migrate
于 2012-05-23T12:53:49.997 回答