Rails, jRuby, ArgumentError: wrong number of arguments calling `to_sql` (2 for 1)

Rails, jRuby, ArgumentError: wrong number of arguments calling `to_sql` (2 for 1)

克隆了新的 rails 项目,并尝试 运行 rake db:migrate 收到以下错误消息。

回溯:

    rake db:migrate --trace
    ** Invoke db:migrate (first_time)
    ** Invoke environment (first_time)
    ** Execute environment rake aborted! ArgumentError: wrong number of arguments calling `to_sql` (2 for 1)
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/jdbc/adapter.rb:535:in `select'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in `select_all'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:22:in `select_one'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:28:in `select_value'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:73:in `select_version'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:81:in `redshift?'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:795:in `client_min_messages='
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:108:in `configure_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/jdbc/adapter.rb:77:in `initialize'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:1404:in `initialize'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/jdbc/connection_methods.rb:12:in `jdbc_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/connection_methods.rb:45:in `postgresql_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `checkout' org/jruby/RubyKernel.java:1501:in `loop'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `checkout'
home/raj/.rvm/rubies/jruby-1.7.12/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/model_schema.rb:308:in `clear_cache!'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/railtie.rb:91:in `_callback_before_13'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:421:in `_run__141113183__prepare__2003038971__callbacks'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:390:in `_run_prepare_callbacks'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
home/raj/.rvm/gems/jruby-1.7.12/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
home/raj/.rvm/gems/jruby-1.7.12/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application/finisher.rb:48:in `Finisher' org/jruby/RubyBasicObject.java:1562:in `instance_exec'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `run_initializers' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
home/raj/projects/property1view.com/config/environment.rb:5:in `(root)' org/jruby/RubyKernel.java:1065:in `require'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:1:in `(root)'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!' org/jruby/RubyProc.java:271:in `call'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:292:in `initialize_tasks' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:240:in `execute'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:179:in `invoke_with_call_chain'
home/raj/.rvm/rubies/jruby-1.7.12/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:201:in `invoke_prerequisites'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_prerequisites'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:178:in `invoke_with_call_chain'
home/raj/.rvm/rubies/jruby-1.7.12/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:106:in `top_level'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:106:in `top_level'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:78:in `run'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:75:in `run' org/jruby/RubyKernel.java:1081:in `load'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/bin/rake:33:in `(root)' org/jruby/RubyKernel.java:1101:in `eval'
home/raj/.rvm/gems/jruby-1.7.12/bin/jruby_executable_hooks:15:in `(root)'

环境

jruby-1.7.12
Rails 3.2.0
psql (PostgreSQL) 9.1.15
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)

config/environment.rb

# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
MyApplication::Application.initialize!

使用 bundle update 命令通过更新数据库相关的 gem 简单地解决了这个问题。